File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # test attrtuple
2+ # we can't test this type directly so we use sys.implementation object
3+
4+ import sys
5+ t = sys .implementation
6+
7+ # test printing of attrtuple
8+ print (str (t ).find ("version=" ) > 0 )
9+
10+ # test read attr
11+ print (isinstance (t .name , str ))
Original file line number Diff line number Diff line change @@ -78,6 +78,7 @@ def test(value, base):
7878test ('0o8' , 8 )
7979test ('0xg' , 16 )
8080test ('1 1' , 16 )
81+ test ('123' , 37 )
8182
8283# check that we don't parse this as a floating point number
8384print (0x1e + 1 )
Original file line number Diff line number Diff line change 6565# test constant integer with more than 255 chars
6666x = 0x84ce72aa8699df436059f052ac51b6398d2511e49631bcb7e71f89c499b9ee425dfbc13a5f6d408471b054f2655617cbbaf7937b7c80cd8865cf02c8487d30d2b0fbd8b2c4e102e16d828374bbc47b93852f212d5043c3ea720f086178ff798cc4f63f787b9c2e419efa033e7644ea7936f54462dc21a6c4580725f7f0e7d1aaaaaaa
6767print (x )
68+
69+ # test parsing ints just on threshold of small to big
70+ # for 32 bit archs
71+ x = 1073741823 # small
72+ x = - 1073741823 # small
73+ x = 1073741824 # big
74+ x = - 1073741824 # big
75+ # for 64 bit archs
76+ x = 4611686018427387903 # small
77+ x = - 4611686018427387903 # small
78+ x = 4611686018427387904 # big
79+ x = - 4611686018427387904 # big
Original file line number Diff line number Diff line change @@ -26,6 +26,9 @@ def test_syntax(code):
2626# bad indentation (lexer error)
2727test_syntax (" a\n " )
2828
29+ # malformed integer literal (parser error)
30+ test_syntax ("123z" )
31+
2932# can't assign to literals
3033test_syntax ("1 = 2" )
3134test_syntax ("'' = 1" )
Original file line number Diff line number Diff line change 99print (sys .version_info [0 ], sys .version_info [1 ])
1010print (sys .byteorder in ('little' , 'big' ))
1111print (sys .maxsize > 100 )
12+ print (sys .implementation .name in ('cpython' , 'micropython' ))
1213
1314try :
1415 sys .exit ()
You can’t perform that action at this time.
0 commit comments