summaryrefslogtreecommitdiffstatshomepage
path: root/tests
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2016-09-02 15:07:42 +1000
committerDamien George <damien.p.george@gmail.com>2016-09-02 15:07:42 +1000
commit58f386135813ab6e55641bec6eae32cc0fd35115 (patch)
tree8af898867c765aefa46e4f3ffaf16bef85e6227c /tests
parent5f3bda422a18d49fb282a93968b658c568343b7d (diff)
downloadmicropython-58f386135813ab6e55641bec6eae32cc0fd35115.tar.gz
micropython-58f386135813ab6e55641bec6eae32cc0fd35115.zip
tests/unix/extra_coverage: Add test for str/bytes with invalid hash.
Diffstat (limited to 'tests')
-rw-r--r--tests/unix/extra_coverage.py9
-rw-r--r--tests/unix/extra_coverage.py.exp5
2 files changed, 13 insertions, 1 deletions
diff --git a/tests/unix/extra_coverage.py b/tests/unix/extra_coverage.py
index 8f330f1da2..72bcc9994a 100644
--- a/tests/unix/extra_coverage.py
+++ b/tests/unix/extra_coverage.py
@@ -5,4 +5,11 @@ except NameError:
import sys
sys.exit()
-extra_coverage()
+data = extra_coverage()
+
+# test hashing of str/bytes that have an invalid hash
+print(data)
+print(hash(data[0]))
+print(hash(data[1]))
+print(hash(bytes(data[0], 'utf8')))
+print(hash(str(data[1], 'utf8')))
diff --git a/tests/unix/extra_coverage.py.exp b/tests/unix/extra_coverage.py.exp
index 44749c45ea..ea73a54e4c 100644
--- a/tests/unix/extra_coverage.py.exp
+++ b/tests/unix/extra_coverage.py.exp
@@ -35,3 +35,8 @@ ementation
12345678
0
0
+('0123456789', b'0123456789')
+7300
+7300
+7300
+7300