diff options
author | xyb <xieyanbo@gmail.com> | 2014-01-15 20:33:48 +0800 |
---|---|---|
committer | xyb <xieyanbo@gmail.com> | 2014-01-15 20:37:17 +0800 |
commit | 3e4ed25138b7ffc295843dfc11e44bccfb22ab9c (patch) | |
tree | a84e190227c5614848361ac2f66290b664182801 /tests/basics | |
parent | 3270fb4be66f2d61de31d2e6315dfdb8ebfb2132 (diff) | |
download | micropython-3e4ed25138b7ffc295843dfc11e44bccfb22ab9c.tar.gz micropython-3e4ed25138b7ffc295843dfc11e44bccfb22ab9c.zip |
add more tests and remove debug code
Diffstat (limited to 'tests/basics')
-rw-r--r-- | tests/basics/tests/int1.py | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/tests/basics/tests/int1.py b/tests/basics/tests/int1.py index 6f3e3f272c..4ce0f9e70c 100644 --- a/tests/basics/tests/int1.py +++ b/tests/basics/tests/int1.py @@ -9,10 +9,13 @@ print(int('-0')) print(int('1')) print(int('+1')) print(int('-1')) +print(int('01')) print(int('9')) print(int('10')) print(int('+10')) print(int('-10')) +print(int('12')) +print(int('-12')) print(int('99')) print(int('100')) print(int('314')) @@ -22,12 +25,26 @@ print(int(' \t\t 314 \t\t ')) print(int(' 1 ')) print(int(' -3 ')) -print(int('10', 16)) +print(int('0', 10)) +print(int('1', 10)) +print(int(' \t 1 \t ', 10)) +print(int('11', 10)) +print(int('11', 16)) +print(int('11', 8)) +print(int('11', 2)) +print(int('11', 36)) print(int('0o123', 0)) +print(int('8388607')) print(int('0x123', 16)) print(int('0X123', 16)) +print(int('0o123', 8)) print(int('0O123', 8)) +print(int('0123', 8)) +print(int('0b100', 2)) print(int('0B100', 2)) +print(int('0100', 2)) +print(int(' \t 0o12', 8)) +print(int('0o12 \t ', 8)) def test(value, base): @@ -37,6 +54,8 @@ def test(value, base): print('ValueError') +test('x', 0) +test('1x', 0) test(' 1x', 0) test(' 1' + chr(2) + ' ', 0) test('', 0) @@ -52,3 +71,4 @@ test('0b', 0) test('0b2', 2) test('0o8', 8) test('0xg', 16) +test('1 1', 16) |