Add more tests.
This commit is contained in:
parent
93b7faa29a
commit
10e21b9770
@ -2,3 +2,16 @@
|
|||||||
for i in range(1, 17):
|
for i in range(1, 17):
|
||||||
for shift in range(70):
|
for shift in range(70):
|
||||||
print(i, '<<', shift, '=', i << shift)
|
print(i, '<<', shift, '=', i << shift)
|
||||||
|
|
||||||
|
# test bit-shifting negative integers
|
||||||
|
for i in range(8):
|
||||||
|
print(-100000000000000000000000000000 << i)
|
||||||
|
print(-100000000000000000000000000001 << i)
|
||||||
|
print(-100000000000000000000000000002 << i)
|
||||||
|
print(-100000000000000000000000000003 << i)
|
||||||
|
print(-100000000000000000000000000004 << i)
|
||||||
|
print(-100000000000000000000000000000 >> i)
|
||||||
|
print(-100000000000000000000000000001 >> i)
|
||||||
|
print(-100000000000000000000000000002 >> i)
|
||||||
|
print(-100000000000000000000000000003 >> i)
|
||||||
|
print(-100000000000000000000000000004 >> i)
|
||||||
|
18
tests/basics/list_slice.py
Normal file
18
tests/basics/list_slice.py
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
# test slices; only 2 argument version supported by Micro Python at the moment
|
||||||
|
x = list(range(10))
|
||||||
|
a = 2
|
||||||
|
b = 4
|
||||||
|
c = 3
|
||||||
|
print(x[:])
|
||||||
|
print(x[::])
|
||||||
|
#print(x[::c])
|
||||||
|
print(x[:b])
|
||||||
|
print(x[:b:])
|
||||||
|
#print(x[:b:c])
|
||||||
|
print(x[a])
|
||||||
|
print(x[a:])
|
||||||
|
print(x[a::])
|
||||||
|
#print(x[a::c])
|
||||||
|
print(x[a:b])
|
||||||
|
print(x[a:b:])
|
||||||
|
#print(x[a:b:c])
|
@ -23,7 +23,7 @@ failed_tests = []
|
|||||||
tests = []
|
tests = []
|
||||||
|
|
||||||
if not sys.argv[1:]:
|
if not sys.argv[1:]:
|
||||||
tests = sorted(glob('basics/*.py') + glob('io/*.py'))
|
tests = sorted(glob('basics/*.py') + glob('io/*.py') + glob('misc/*.py'))
|
||||||
else:
|
else:
|
||||||
tests = sys.argv[1:]
|
tests = sys.argv[1:]
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user