test suite 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 list • frozen copy() !> string
private string join list(readonly list[string] strings)
var string result : ""
for (the string : strings)
if result • is 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
test case 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")
test case test parse()
assert the matcher • parse("abc") == "-a-b-c"
assert the matcher • parse("AbC") == "-A-b-C"
assert the matcher • parse("AaaBbCcc") == "-Aaa-Bb-Ccc"
assert the matcher • parse("AaaBBBCcc") == "-Aaa-BBB-Ccc"
assert the matcher • parse("abcABC") == "-a-b-c/-A-B-C"
assert the matcher • parse("AbCaBc") == "-A-b-C/-a-B-c"
assert the matcher • parse("AABBCCabcABC") == "-AA-BB-CC/-a-b-c/-A-B-C"