class test repeat matcher
private boolean match a(character c) pure
return c == 'a' || c == 'A'
private boolean match b(character c) pure
return c == 'b' || c == 'B'
private boolean match c(character c) pure
return c == 'c' || c == 'C'
private string as string(readonly list[character] char list)
return char listfrozen copy() !> base string
private string join list(readonly list[string] strings)
var string result : ""
for (the string : strings)
if resultis empty
result = the string
else
result = result ++ "/" ++ the string
return result
string match procedure(readonly list[any value] the list)
var string result : ""
for (element : the list)
assert element is string
result = result ++ "-" ++ element
return result
testcase test match()
assert the matcher("abc")
assert the matcher("AbCabc")
assert the matcher("AaaBbCccABC")
assert the matcher("AaaBbCccABCabc")
assert the matcher("AaaBBBCcc")
assert !the matcher("bac")
assert !the matcher("aabb")
assert !the matcher("aaca")
testcase test parse()
assert the matcherparse("abc") == "-a-b-c"
assert the matcherparse("AbC") == "-A-b-C"
assert the matcherparse("AaaBbCcc") == "-Aaa-Bb-Ccc"
assert the matcherparse("AaaBBBCcc") == "-Aaa-BBB-Ccc"
assert the matcherparse("abcABC") == "-a-b-c/-A-B-C"
assert the matcherparse("AbCaBc") == "-A-b-C/-a-B-c"
assert the matcherparse("AABBCCabcABC") == "-AA-BB-CC/-a-b-c/-A-B-C"