From 1850acb5b77aabbf4e9ba24ae6d5314c3d4d896a Mon Sep 17 00:00:00 2001 From: pacien Date: Sat, 1 Dec 2018 15:55:33 +0100 Subject: add dynamic symbol length to output --- tests/thuffman.nim | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'tests') diff --git a/tests/thuffman.nim b/tests/thuffman.nim index 0294694..db209f4 100644 --- a/tests/thuffman.nim +++ b/tests/thuffman.nim @@ -90,15 +90,15 @@ suite "huffencoder": test "buildCodebook": let codebook = buildCodebook(tree, uint) check codebook.len == 3 - check codebook[1'u] == 0b0 - check codebook[2'u] == 0b01 - check codebook[3'u] == 0b11 + check codebook[1'u] == (1, 0b0'u) + check codebook[2'u] == (2, 0b01'u) + check codebook[3'u] == (2, 0b11'u) test "encode": let encoder = tree.encoder(uint) - check encoder.encode(1'u) == 0b0 - check encoder.encode(2'u) == 0b01 - check encoder.encode(3'u) == 0b11 + check encoder.encode(1'u) == (1, 0b0'u) + check encoder.encode(2'u) == (2, 0b01'u) + check encoder.encode(3'u) == (2, 0b11'u) suite "huffdecoder": test "decode": -- cgit v1.2.3