Skip to content

Commit

Permalink
Add some tests for plover:deleted
Browse files Browse the repository at this point in the history
  • Loading branch information
user202729 committed Jan 21, 2024
1 parent 3b4d56d commit 2618cbf
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/test_steno_dictionary.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,26 @@ def test_dictionary_collection():
d1 = StenoDictionary()
d1[('S',)] = 'a'
d1[('T',)] = 'b'
d1[('H',)] = '{PLOVER:deleted}'
d1[('R',)] = 'e'
d1.path = 'd1'
d2 = StenoDictionary()
d2[('S',)] = 'c'
d2[('W',)] = 'd'
d2[('H',)] = 'f'
d2[('R',)] = '{plover:deleted}'
d2.path = 'd2'
dc = StenoDictionaryCollection([d2, d1])
assert dc.lookup(('S',)) == 'c'
assert dc.lookup(('W',)) == 'd'
assert dc.lookup(('T',)) == 'b'
assert dc.lookup(('H',)) == 'f'
assert dc.lookup(('R',)) == None
assert dc.lookup_from_all(('S',)) == [('c', d2), ('a', d1)]
assert dc.lookup_from_all(('W',)) == [('d', d2)]
assert dc.lookup_from_all(('T',)) == [('b', d1)]
assert dc.lookup_from_all(('H',)) == [('f', d2), ('{PLOVER:deleted}', d1)]
assert dc.lookup_from_all(('R',)) == [('{plover:deleted}', d2), ('e', d1)]
f = lambda k, v: v == 'c'
dc.add_filter(f)
assert dc.lookup(('S',)) == 'a'
Expand Down

0 comments on commit 2618cbf

Please sign in to comment.