diff options
author | Marc-André Lemburg <mal@egenix.com> | 2001-01-17 19:11:13 (GMT) |
---|---|---|
committer | Marc-André Lemburg <mal@egenix.com> | 2001-01-17 19:11:13 (GMT) |
commit | 3661908a6ac75026e4504d9f62a6ac2e2fb2ec5e (patch) | |
tree | eea0f44df59aaaf014eb4580f1fad308e31601bf /Lib/test/test_grammar.py | |
parent | 8551dd60781f738e5e5ef4e22b6f071d27e20b50 (diff) | |
download | cpython-3661908a6ac75026e4504d9f62a6ac2e2fb2ec5e.zip cpython-3661908a6ac75026e4504d9f62a6ac2e2fb2ec5e.tar.gz cpython-3661908a6ac75026e4504d9f62a6ac2e2fb2ec5e.tar.bz2 |
This patch removes all uses of "assert" in the regression test suite
and replaces them with a new API verify(). As a result the regression
suite will also perform its tests in optimization mode.
Written by Marc-Andre Lemburg. Copyright assigned to Guido van Rossum.
Diffstat (limited to 'Lib/test/test_grammar.py')
-rw-r--r-- | Lib/test/test_grammar.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/Lib/test/test_grammar.py b/Lib/test/test_grammar.py index b990c83..503cc80 100644 --- a/Lib/test/test_grammar.py +++ b/Lib/test/test_grammar.py @@ -83,18 +83,18 @@ x = 3.1e4 print '1.1.3 String literals' -##def assert(s): +##def verify(s): ## if not s: raise TestFailed, 'see traceback' -x = ''; y = ""; assert(len(x) == 0 and x == y) -x = '\''; y = "'"; assert(len(x) == 1 and x == y and ord(x) == 39) -x = '"'; y = "\""; assert(len(x) == 1 and x == y and ord(x) == 34) +x = ''; y = ""; verify(len(x) == 0 and x == y) +x = '\''; y = "'"; verify(len(x) == 1 and x == y and ord(x) == 39) +x = '"'; y = "\""; verify(len(x) == 1 and x == y and ord(x) == 34) x = "doesn't \"shrink\" does it" y = 'doesn\'t "shrink" does it' -assert(len(x) == 24 and x == y) +verify(len(x) == 24 and x == y) x = "does \"shrink\" doesn't it" y = 'does "shrink" doesn\'t it' -assert(len(x) == 24 and x == y) +verify(len(x) == 24 and x == y) x = """ The "quick" brown fox @@ -102,25 +102,25 @@ jumps over the 'lazy' dog. """ y = '\nThe "quick"\nbrown fox\njumps over\nthe \'lazy\' dog.\n' -assert(x == y) +verify(x == y) y = ''' The "quick" brown fox jumps over the 'lazy' dog. -'''; assert(x == y) +'''; verify(x == y) y = "\n\ The \"quick\"\n\ brown fox\n\ jumps over\n\ the 'lazy' dog.\n\ -"; assert(x == y) +"; verify(x == y) y = '\n\ The \"quick\"\n\ brown fox\n\ jumps over\n\ the \'lazy\' dog.\n\ -'; assert(x == y) +'; verify(x == y) print '1.2 Grammar' |