From 72a88720c416355cf984c1912857b9da0a6e6766 Mon Sep 17 00:00:00 2001 From: chirag-parmar Date: Fri, 25 Oct 2024 15:08:54 +0530 Subject: [PATCH] add check statements --- tests/rlp/test_optional_fields.nim | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/rlp/test_optional_fields.nim b/tests/rlp/test_optional_fields.nim index b5041767..c234c0c4 100644 --- a/tests/rlp/test_optional_fields.nim +++ b/tests/rlp/test_optional_fields.nim @@ -53,13 +53,16 @@ objWithEmptyTrailingOptionals.j = Opt.some(0'u64) suite "test optional fields": test "all optionals are empty": let bytes = rlp.encode(objWithEmptyOptional) + check: bytes.len == 7 # 6 mandatory fields + prefix byte test "all optionals are non empty": let bytes = rlp.encode(objWithNonEmptyOptional) + check: bytes.len == 15 # 6 mandatory + 8 optional + prefix test "Only trailing optionals are non empty": let bytes = rlp.encode(objWithNonEmptyTrailingOptionals) - + check: bytes.len == 10 # 6 mandatory + 3 trailing optional + prefix + test "Only trailing optionals are empty": let bytes = rlp.encode(objWithEmptyTrailingOptionals) - + check: bytes.len == 12 # 6 mandatory + 5 non trailing + prefix