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
Changes from 1 commit
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
Next Next commit
Update libdatatrie to 6ef4485474890606946ed208ff453231b581cdf1 and
provide tests for #74

This resolves #74
c4f3a0ce committed Dec 8, 2019

Verified

This commit was signed with the committer’s verified signature.
commit 0cca86eb411162ac12b08e8fd78f8f5f2a80e016
18 changes: 18 additions & 0 deletions tests/test_trie.py
Original file line number Diff line number Diff line change
@@ -423,3 +423,21 @@ 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 hypothesis.strategies as st
from hypothesis import given

alphabet = [chr(i) for i in range(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

_()