test suite test list pattern
test case test match()
the pattern : list pattern[character] • new("abc")
assert the pattern("abc")
assert !the pattern("xx")
assert !the pattern("ab")
assert !the pattern("abcd")
test case test viable prefix()
the pattern : list pattern[character] • new("abc")
assert the patternis viable prefix("")
assert the patternis viable prefix("a")
assert the patternis viable prefix("abc")
assert !the patternis viable prefix("xy")
assert !the patternis viable prefix("aa")
assert !the patternis viable prefix("abcdef")
test case test match prefix()
the pattern : list pattern[character] • new("abc")
assert the patternmatch prefix("") is null
assert the patternmatch prefix("abc") == 3
assert the patternmatch prefix("ab") is null
assert the patternmatch prefix("abcdef") == 3
test case test find first()
the pattern : list pattern[character] • new("abc")
assert the patternfind first("", 0) is null
assert the patternfind first("foo", 0) is null
assert the patternfind first("bca", 1) is null
match : the patternfind first("abc", 0)
assert match is_not null
assert matchbegin == 0
assert matchend == 3
match2 : the patternfind first("abcxabcdef", 2)
assert match2 is_not null
assert match2begin == 4
assert match2end == 7
test case test split()
the pattern : list pattern[character] • new("abc")
split0 : the patternsplit("foo")
assert split0size == 1
assert equals(split0[0], "foo")
split1 : the patternsplit("fooabcxyzabc")
assert split1size == 3
assert equals(split1[0], "foo")
assert equals(split1[1], "xyz")
assert equals(split1[2], "")
split2 : the patternsplit("abc1abc2abc3")
assert split2size == 4
assert equals(split2[0], "")
assert equals(split2[1], "1")
assert equals(split2[2], "2")
assert equals(split2[3], "3")
boolean equals(immutable list[character] s0, string s1)
return (s0 !> string) == s1