diff options
Diffstat (limited to 'tests/stdlib')
-rw-r--r-- | tests/stdlib/tjsonutils.nim | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/stdlib/tjsonutils.nim b/tests/stdlib/tjsonutils.nim index 12a4b20eb..1681f4a09 100644 --- a/tests/stdlib/tjsonutils.nim +++ b/tests/stdlib/tjsonutils.nim @@ -410,6 +410,13 @@ template fn() = doAssert foo.c == 0 doAssert foo.c0 == 42 + + block testInvalidTupleLength: + let json = parseJson("[0]") + # Should raise ValueError instead of index error + doAssertRaises(ValueError): + discard json.jsonTo((int, int)) + type InnerEnum = enum A @@ -431,7 +438,6 @@ template fn() = let json = inner.toJson(ToJsonOptions(enumMode: joptEnumSymbol)) doAssert $json == """{"x":"hello","y":"A"}""" - when false: ## TODO: Implement support for nested variant objects allowing the tests ## bellow to pass. |