diff --git a/libdatrie b/libdatrie index d1dfdb8..6ef4485 160000 --- a/libdatrie +++ b/libdatrie @@ -1 +1 @@ -Subproject commit d1dfdb831093892541cae46eba82c46aec94f726 +Subproject commit 6ef4485474890606946ed208ff453231b581cdf1 diff --git a/tests/test_trie.py b/tests/test_trie.py index 492e524..3e6cb14 100644 --- a/tests/test_trie.py +++ b/tests/test_trie.py @@ -423,3 +423,24 @@ def test_trie_fuzzy(): for index, word in enumerated_words: assert word in trie, word assert trie[word] == index, (word, index) + +def test_trie_handles_long_alphabets(): + # https://github.com/pytries/datrie/issues/74 + + import sys + import hypothesis.strategies as st + from hypothesis import given + + if sys.version_info > (2, ): + + alphabet = [chr(i) for i in range(1, 1500)] + @given(st.lists(st.text(alphabet))) + def _(xs): + trie = datrie.Trie(alphabet) + for x in xs: + trie[x] = True + + for x in xs: + assert x in trie + + _()