summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2018-04-05 01:04:38 +1000
committerDamien George <damien.p.george@gmail.com>2018-04-05 01:04:38 +1000
commit1bfc774a086127cce539d50c1c1baedd5f609d41 (patch)
tree7008fa00bbaf34bf691eec5b0a9e5ee6e20bd2a5
parent22161acf470e49aed359187cbe4db7014d698b05 (diff)
downloadmicropython-1bfc774a086127cce539d50c1c1baedd5f609d41.tar.gz
micropython-1bfc774a086127cce539d50c1c1baedd5f609d41.zip
tests/basics/string_compare.py: Add test with string that hashes to 0.
The string "Q+?" is special in that it hashes to zero with the djb2 algorithm (among other strings), and a zero hash should be incremented to a hash of 1.
-rw-r--r--tests/basics/string_compare.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/basics/string_compare.py b/tests/basics/string_compare.py
index f011ed3630..6515809b36 100644
--- a/tests/basics/string_compare.py
+++ b/tests/basics/string_compare.py
@@ -53,3 +53,6 @@ print("1/" <= "1")
# that does have a hash, but the lengths of the two strings are different
import sys
print(sys.version == 'a long string that has a hash')
+
+# this special string would have a hash of 0 but is incremented to 1
+print('Q+?' == 'Q' + '+?')