Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions tests/test_trie.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

_()