diff options
author | Raymond Hettinger <python@rcn.com> | 2002-08-09 00:43:38 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2002-08-09 00:43:38 (GMT) |
commit | 8da9da0ccc7c63aff0fbc5d65b3e0ca28a754090 (patch) | |
tree | 59a3518e6648fdf6324966fdba8d306defe108ee | |
parent | cb4321eb172a001d38c76e417c50303fca733b62 (diff) | |
download | cpython-8da9da0ccc7c63aff0fbc5d65b3e0ca28a754090.zip cpython-8da9da0ccc7c63aff0fbc5d65b3e0ca28a754090.tar.gz cpython-8da9da0ccc7c63aff0fbc5d65b3e0ca28a754090.tar.bz2 |
Revised the test suite for 'contains' to use the test() function argument
rather than vereq(). While it was effectively testing regular strings, it
ignored the test() function argument when called by test_userstring.py.
-rw-r--r-- | Lib/test/string_tests.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/Lib/test/string_tests.py b/Lib/test/string_tests.py index c8feb19..1729999 100644 --- a/Lib/test/string_tests.py +++ b/Lib/test/string_tests.py @@ -305,12 +305,12 @@ def test_exception(lhs, rhs, msg): raise TestFailed, msg def run_contains_tests(test): - vereq('' in '', True) - vereq('' in 'abc', True) - vereq('\0' in 'abc', False) - vereq('\0' in '\0abc', True) - vereq('\0' in 'abc\0', True) - vereq('a' in '\0abc', True) - vereq('asdf' in 'asdf', True) - vereq('asdf' in 'asd', False) - vereq('asdf' in '', False) + test('__contains__', '', True, '') # vereq('' in '', True) + test('__contains__', 'abc', True, '') # vereq('' in 'abc', True) + test('__contains__', 'abc', False, '\0') # vereq('\0' in 'abc', False) + test('__contains__', '\0abc', True, '\0') # vereq('\0' in '\0abc', True) + test('__contains__', 'abc\0', True, '\0') # vereq('\0' in 'abc\0', True) + test('__contains__', '\0abc', True, 'a') # vereq('a' in '\0abc', True) + test('__contains__', 'asdf', True, 'asdf') # vereq('asdf' in 'asdf', True) + test('__contains__', 'asd', False, 'asdf') # vereq('asdf' in 'asd', False) + test('__contains__', '', False, 'asdf') # vereq('asdf' in '', False) |