Skip to content

Commit

Permalink
Update libdatatrie to 6ef4485474890606946ed208ff453231b581cdf1 and
Browse files Browse the repository at this point in the history
provide tests for pytries#74

This resolves pytries#74
  • Loading branch information
c4f3a0ce committed Dec 8, 2019
1 parent fa3cfc3 commit 0cca86e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
18 changes: 18 additions & 0 deletions tests/test_trie.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

_()

0 comments on commit 0cca86e

Please sign in to comment.