From fbabe954b411e1b155b90d4c3fb05ac33a46bdff Mon Sep 17 00:00:00 2001 From: Eric <5089238+emizzle@users.noreply.github.com> Date: Mon, 13 May 2024 15:07:00 +1000 Subject: [PATCH] add empty string test for UInt256 (#15) --- tests/json/testDeserialize.nim | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/json/testDeserialize.nim b/tests/json/testDeserialize.nim index 56e860a..564691f 100644 --- a/tests/json/testDeserialize.nim +++ b/tests/json/testDeserialize.nim @@ -19,6 +19,10 @@ suite "json serialization - deserialize": let json = newJString("Second") check !MyEnum.fromJson(json) == Second + test "deserializes UInt256 from an empty string": + let json = newJString("") + check !UInt256.fromJson(json) == 0.u256 + test "deserializes UInt256 with no prefix": let json = newJString("1") check !UInt256.fromJson(json) == 1.u256