@@ -28,6 +28,7 @@ def remove_prefix_suffix(x: str, y: str) -> Tuple[str, str]:
2828[file driver.py]
2929from native import f, g, tostr, booltostr, concat, eq, match, match_tuple, remove_prefix_suffix
3030import sys
31+ from testutil import assertRaises
3132
3233assert f() == 'some string'
3334assert f() is sys.intern('some string')
@@ -51,6 +52,12 @@ assert match_tuple('abc', ('d', 'e')) == (False, False)
5152assert match_tuple('abc', ('a', 'c')) == (True, True)
5253assert match_tuple('abc', ('a',)) == (True, False)
5354assert match_tuple('abc', ('c',)) == (False, True)
55+ assert match_tuple('abc', ('x', 'y', 'z')) == (False, False)
56+ assert match_tuple('abc', ('x', 'y', 'z', 'a', 'c')) == (True, True)
57+ with assertRaises(TypeError, "tuple for startswith must only contain str"):
58+ assert match_tuple('abc', (None,))
59+ with assertRaises(TypeError, "tuple for endswith must only contain str"):
60+ assert match_tuple('abc', ('a', None))
5461
5562assert remove_prefix_suffix('', '') == ('', '')
5663assert remove_prefix_suffix('abc', 'a') == ('bc', 'abc')
0 commit comments