Commit 10e21b97 authored by Damien George's avatar Damien George
Browse files

Add more tests.

parent 93b7faa2
......@@ -2,3 +2,16 @@
for i in range(1, 17):
for shift in range(70):
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)
# 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 = []
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:
tests = sys.argv[1:]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment