add tests for match end.