Skip to content
Snippets Groups Projects
Commit 3c82d1d3 authored by Damien George's avatar Damien George
Browse files

tests/basics: Add more tuple tests to improve coverage testing.

parent 21967990
Branches
No related tags found
No related merge requests found
......@@ -3,6 +3,7 @@
print(hash(False))
print(hash(True))
print({():1}) # hash tuple
print({(1,):1}) # hash non-empty tuple
print({1 << 66:1}) # hash big int
print({-(1 << 66):2}) # hash negative big int
print(hash in {hash:1}) # hash function
......
......@@ -16,3 +16,18 @@ print(x[:-1])
print(x[2:3])
print(x + (10, 100, 10000))
# construction of tuple from large iterator (tests implementation detail of uPy)
print(tuple(range(20)))
# unsupported unary operation
try:
+()
except TypeError:
print('TypeError')
# unsupported type on RHS of add
try:
() + None
except TypeError:
print('TypeError')
......@@ -10,3 +10,9 @@ for i in (-4, -2, 0, 2, 4):
a = (1, 2, 3)
c = a * 3
print(a, c)
# unsupported type on RHS
try:
() * None
except TypeError:
print('TypeError')
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment