diff --git a/tests/basics/int-big-lshift.py b/tests/basics/int-big-lshift.py index 7d1fe3fe1e..af1d97504c 100644 --- a/tests/basics/int-big-lshift.py +++ b/tests/basics/int-big-lshift.py @@ -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) diff --git a/tests/basics/list_slice.py b/tests/basics/list_slice.py new file mode 100644 index 0000000000..a9962132e2 --- /dev/null +++ b/tests/basics/list_slice.py @@ -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]) diff --git a/tests/run-tests b/tests/run-tests index 259c18cd22..134ed52617 100755 --- a/tests/run-tests +++ b/tests/run-tests @@ -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:]