summaryrefslogtreecommitdiffstatshomepage
path: root/tests/basics/builtin_hash.py
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2015-01-29 00:44:11 +0000
committerDamien George <damien.p.george@gmail.com>2015-01-29 00:44:11 +0000
commit12c66be2b8baab093c7be5e2108d2767c9779a69 (patch)
tree7db0c4259eaae84cea25d79b3856fc08d863cef1 /tests/basics/builtin_hash.py
parent81e70a88a7a4adb33c4a5d049c83f42d94e6332b (diff)
downloadmicropython-12c66be2b8baab093c7be5e2108d2767c9779a69.tar.gz
micropython-12c66be2b8baab093c7be5e2108d2767c9779a69.zip
tests: Add some tests to improve coverage.
Used gcov to find some parts of vm.c, runtime.c, obj.c that were not covered by any tests. Still need to use gcov more thoroughly.
Diffstat (limited to 'tests/basics/builtin_hash.py')
-rw-r--r--tests/basics/builtin_hash.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/basics/builtin_hash.py b/tests/basics/builtin_hash.py
index c4c7019b47..0abfe980e1 100644
--- a/tests/basics/builtin_hash.py
+++ b/tests/basics/builtin_hash.py
@@ -1,5 +1,16 @@
# test builtin hash function
+print(hash(False))
+print(hash(True))
+print({():1}) # hash tuple
+print({1 << 66:1}) # hash big int
+print(hash in {hash:1}) # hash function
+
+try:
+ hash([])
+except TypeError:
+ print("TypeError")
+
class A:
def __hash__(self):
return 123