mirror of
https://github.com/python/cpython.git
synced 2025-08-01 23:53:15 +00:00
Restore the hex/oct constant tests that Barry commented out for fear
of FutureWarnings. Added a comment explaining the situation.
This commit is contained in:
parent
604cd6ae79
commit
f0253f2bc5
1 changed files with 9 additions and 2 deletions
|
@ -1,6 +1,13 @@
|
||||||
# Python test set -- part 1, grammar.
|
# Python test set -- part 1, grammar.
|
||||||
# This just tests whether the parser accepts them all.
|
# This just tests whether the parser accepts them all.
|
||||||
|
|
||||||
|
# NOTE: When you run this test as a script from the command line, you
|
||||||
|
# get warnings about certain hex/oct constants. Since those are
|
||||||
|
# issued by the parser, you can't suppress them by adding a
|
||||||
|
# filterwarnings() call to this module. Therefore, to shut up the
|
||||||
|
# regression test, the filterwarnings() call has been added to
|
||||||
|
# regrtest.py.
|
||||||
|
|
||||||
from test.test_support import TestFailed, verify, check_syntax
|
from test.test_support import TestFailed, verify, check_syntax
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
@ -32,8 +39,8 @@ except ImportError:
|
||||||
if maxint == 2147483647:
|
if maxint == 2147483647:
|
||||||
if -2147483647-1 != -020000000000: raise TestFailed, 'max negative int'
|
if -2147483647-1 != -020000000000: raise TestFailed, 'max negative int'
|
||||||
# XXX -2147483648
|
# XXX -2147483648
|
||||||
#if 037777777777 != -1: raise TestFailed, 'oct -1'
|
if 037777777777 != -1: raise TestFailed, 'oct -1'
|
||||||
#if 0xffffffff != -1: raise TestFailed, 'hex -1'
|
if 0xffffffff != -1: raise TestFailed, 'hex -1'
|
||||||
for s in '2147483648', '040000000000', '0x100000000':
|
for s in '2147483648', '040000000000', '0x100000000':
|
||||||
try:
|
try:
|
||||||
x = eval(s)
|
x = eval(s)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue