Skip to content

Commit d10c47a

Browse files
committed
Add some tests for #492
1 parent ed49554 commit d10c47a

5 files changed

+51
-0
lines changed
990 Bytes
Binary file not shown.
769 Bytes
Binary file not shown.

tests/input/test_integers_py3.py

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
"""
2+
test_integers.py -- source test pattern for integers
3+
4+
This source is part of the decompyle test suite.
5+
Snippet taken from python libs's test_class.py
6+
7+
decompyle is a Python byte-code decompiler
8+
See http://www.goebel-consult.de/decompyle/ for download and
9+
for further information
10+
"""
11+
12+
import sys
13+
14+
i = 1
15+
i = 42
16+
i = -1
17+
i = -42
18+
i = sys.maxsize
19+
minsize = -sys.maxsize - 1
20+
print(sys.maxsize)
21+
print(minsize)
22+
print(minsize - 1)
23+
print()
24+
i = -2147483647
25+
print(i, repr(i))
26+
i = i - 1
27+
print(i, repr(i))
28+
i = -0x80000000
29+
print(i, repr(i))
30+
i = -0x80000001
31+
print(i, repr(i))

tests/tokenized/test_integers_py3.txt

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
'\ntest_integers.py -- source test pattern for integers\n\nThis source is part of the decompyle test suite.\nSnippet taken from python libs\'s test_class.py\n\ndecompyle is a Python byte-code decompiler\nSee http://www.goebel-consult.de/decompyle/ for download and\nfor further information\n' <EOL>
2+
import sys <EOL>
3+
i = 1 <EOL>
4+
i = 42 <EOL>
5+
i = - 1 <EOL>
6+
i = - 42 <EOL>
7+
i = sys . maxsize <EOL>
8+
minsize = - ( sys . maxsize ) - 1 <EOL>
9+
print ( sys . maxsize ) <EOL>
10+
print ( minsize ) <EOL>
11+
print ( minsize - 1 ) <EOL>
12+
print ( ) <EOL>
13+
i = - 2147483647 <EOL>
14+
print ( i , repr ( i ) ) <EOL>
15+
i = i - 1 <EOL>
16+
print ( i , repr ( i ) ) <EOL>
17+
i = - 2147483648 <EOL>
18+
print ( i , repr ( i ) ) <EOL>
19+
i = - 0 x80000001 <EOL>
20+
print ( i , repr ( i ) ) <EOL>

tests/xfail/test_integers_py3.3.0.pyc

772 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)