Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update libdatatrie to 6ef4485474890606946ed208ff453231b581cdf1 #75

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
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

_()