diff options
author | Guido van Rossum <guido@python.org> | 1993-11-08 15:05:21 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1993-11-08 15:05:21 (GMT) |
commit | e65cce5eec23812d77a54095209c923937cc3c92 (patch) | |
tree | ed0b87870ad9c6278e43acf63685b8823cce018c /Lib/test/test_grammar.py | |
parent | db65a6ce556b1e311d03837fbf85ca52ef2c5d07 (diff) | |
download | cpython-e65cce5eec23812d77a54095209c923937cc3c92.zip cpython-e65cce5eec23812d77a54095209c923937cc3c92.tar.gz cpython-e65cce5eec23812d77a54095209c923937cc3c92.tar.bz2 |
* string.py: added rindex(), rfind(); changed index() to interpret
negative start indices starting from the right.
* ftplib.py: debug() -> set_debuglevel(); change demo to use __init__().
* os.py: added execl, execlp, and execvp.
* lambda.py: removed (now that we have built-in map, reduce, bagof, lambda)
* test_b{1,2}.py, testall.out: added tests for bagof, lambda, map, reduce
* commands.py: use os, not posix
* test_grammar.py: make it easy to disable non-portable int overflow tests
* dis.py: don't abuse range()
Diffstat (limited to 'Lib/test/test_grammar.py')
-rw-r--r-- | Lib/test/test_grammar.py | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/Lib/test/test_grammar.py b/Lib/test/test_grammar.py index f07f75b..4c9e7b0 100644 --- a/Lib/test/test_grammar.py +++ b/Lib/test/test_grammar.py @@ -24,16 +24,19 @@ print '1.1.2.1 Plain integers' if 0xff <> 255: raise TestFailed, 'hex int' if 0377 <> 255: raise TestFailed, 'octal int' if 2147483647 != 017777777777: raise TestFailed, 'max positive int' -if -2147483647-1 != 020000000000: raise TestFailed, 'max negative int' -# XXX -2147483648 -if 037777777777 != -1: raise TestFailed, 'oct -1' -if 0xffffffff != -1: raise TestFailed, 'hex -1' -for s in '2147483648', '040000000000', '0x100000000': - try: - x = eval(s) - except OverflowError: - continue - raise TestFailed, 'No OverflowError on huge integer literal ' + `s` +# Change the following line to "if 0:" if you have 64-bit integers +if 1: + if -2147483647-1 != 020000000000: raise TestFailed, 'max negative int' + # XXX -2147483648 + if 037777777777 != -1: raise TestFailed, 'oct -1' + if 0xffffffff != -1: raise TestFailed, 'hex -1' + for s in '2147483648', '040000000000', '0x100000000': + try: + x = eval(s) + except OverflowError: + continue + raise TestFailed, \ + 'No OverflowError on huge integer literal ' + `s` print '1.1.2.2 Long integers' x = 0L |