Test that huffman codec works with empty freqs dict

This commit is contained in:
Matthew Honnibal 2016-10-23 16:27:45 +02:00
parent 15c9b59f0e
commit 99ff8b902f

View File

@ -50,6 +50,11 @@ def test1():
assert codec.strings == [c for i, c in py_codes]
def test_empty():
codec = HuffmanCodec({})
assert codec.strings == []
def test_round_trip():
freqs = {'the': 10, 'quick': 3, 'brown': 4, 'fox': 1, 'jumped': 5, 'over': 8,
'lazy': 1, 'dog': 2, '.': 9}