From 3b2ce4e464e1a5228de239413b60b0cc068afaaf Mon Sep 17 00:00:00 2001 From: coffeepots Date: Mon, 16 Jul 2018 17:50:47 +0100 Subject: [PATCH] Add test for empty byte ranges --- tests/test_api_usage.nim | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/test_api_usage.nim b/tests/test_api_usage.nim index 647cf28..8529960 100644 --- a/tests/test_api_usage.nim +++ b/tests/test_api_usage.nim @@ -167,3 +167,8 @@ test "encode byte arrays": # The first byte here is the length of the datum (132 - 128 => 4) $(rlp.listElem(1).rawData) == "R[132, 6, 8, 12, 123]" +test "empty byte arrays": + var + rlp = rlpFromBytes rlp.encode("") + b = rlp.toBytes + check $b == "R[]"