def test_match_optionals(): assert matches("a,b", "a,b||") assert matches("a,b", "a,b|c|") assert matches("a,b,c", "a,b|c|") assert matches("a,b,c", "a,b|c,d|") assert matches("a,b", "a,b|c|*") assert not matches("a,b,d", "a,b|c|") assert matches("a,b,d", "a,b|c|*") assert matches("", "||") assert not matches("a", "||")
def test_match_special_case(): assert not matches("", "||*") assert not matches("a,b,c", "||*")
def test_match_caching(): assert matches("a,b", "a,b||") assert matches("a,b", "a||*") assert not matches("a,b", "c||*") assert matches("a,b", "a||*") assert not matches("a,b", "c||*")