test suite test procedure matcher
matcher[character, string] make matcher()
return procedure matcher[character, string] • new(repeat element[character] • new(test predicate, false), as string)
test case test match()
assert the matcher("a")
assert the matcher("ab")
assert the matcher("abca")
assert !the matcher("")
assert !the matcher("abcda")
assert !the matcher("y")
assert !the matcher("xab")
assert the matcher • parse("a") == "a"
assert the matcher • parse("ab") == "ab"
assert the matcher • parse("abca") == "abca"
test case test viable prefix()
assert the pattern • is viable prefix("")
assert the pattern • is viable prefix("a")
assert the pattern • is viable prefix("ab")
assert !the pattern • is viable prefix("y")
assert !the pattern • is viable prefix("ay")
test case test match prefix()
assert the pattern • match prefix("a") == 1
assert the pattern • match prefix("abc") == 3
assert the pattern • match prefix("abcdef") == 3
assert the pattern • match prefix("abcabc") == 6
test case test find first()
test case test split()
assert split0 • size == 1
assert equals(split0[0], "foo")
assert split1 • size == 3
assert equals(split1[0], "foo")
assert equals(split1[1], "xyz")
assert equals(split1[2], "")
assert split2 • size == 4
assert equals(split2[0], "")
assert equals(split2[1], "1")
assert equals(split2[2], "2")
assert equals(split2[3], "3")