Test match_ends