Skip to content

Commit 1bfc774

Browse files
committed
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.
1 parent 22161ac commit 1bfc774

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

tests/basics/string_compare.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,6 @@
5353
# that does have a hash, but the lengths of the two strings are different
5454
import sys
5555
print(sys.version == 'a long string that has a hash')
56+
57+
# this special string would have a hash of 0 but is incremented to 1
58+
print('Q+?' == 'Q' + '+?')

0 commit comments

Comments
 (0)