From 57897698d18bf56808409c7d52efa394a01bf549 Mon Sep 17 00:00:00 2001 From: def Date: Tue, 2 Feb 2016 00:47:11 +0100 Subject: Fix test cases for JSON object changes --- tests/closure/tclosure4.nim | 8 ++++---- tests/stdlib/tmitems.nim | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'tests') diff --git a/tests/closure/tclosure4.nim b/tests/closure/tclosure4.nim index 10c7cac54..69c076cd5 100644 --- a/tests/closure/tclosure4.nim +++ b/tests/closure/tclosure4.nim @@ -1,13 +1,13 @@ import json, tables, sequtils -proc run(json_params: TTable) = +proc run(json_params: Table) = let json_elems = json_params["files"].elems # These fail compilation. - var files = map(json_elems, proc (x: PJsonNode): string = x.str) - #var files = json_elems.map do (x: PJsonNode) -> string: x.str + var files = map(json_elems, proc (x: JsonNode): string = x.str) + #var files = json_elems.map do (x: JsonNode) -> string: x.str echo "Hey!" when isMainModule: let text = """{"files": ["a", "b", "c"]}""" - run(toTable((text.parseJson).fields)) + run((text.parseJson).fields) diff --git a/tests/stdlib/tmitems.nim b/tests/stdlib/tmitems.nim index 27ff344e5..0c4a1dd04 100644 --- a/tests/stdlib/tmitems.nim +++ b/tests/stdlib/tmitems.nim @@ -11,7 +11,7 @@ fpqeew [11, 12, 13] [11, 12, 13] [11, 12, 13] -{"key1":11,"key2":12,"key3":13} +{"key3":13,"key2":12,"key1":11} [11,12,13] -- cgit 1.4.1-2-gfad0 From 510a503f341f616cdf97af1231b2a704778b514e Mon Sep 17 00:00:00 2001 From: def Date: Sun, 7 Feb 2016 02:35:20 +0100 Subject: Fix tmitems test for changed behaviour of json --- tests/stdlib/tmitems.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/stdlib/tmitems.nim b/tests/stdlib/tmitems.nim index 0c4a1dd04..c713d91a4 100644 --- a/tests/stdlib/tmitems.nim +++ b/tests/stdlib/tmitems.nim @@ -11,7 +11,7 @@ fpqeew [11, 12, 13] [11, 12, 13] [11, 12, 13] -{"key3":13,"key2":12,"key1":11} +11 12 13 [11,12,13] @@ -115,7 +115,7 @@ block: var j = parseJson """{"key1": 1, "key2": 2, "key3": 3}""" for key,val in j.pairs: val.num += 10 - echo j + echo j["key1"], " ", j["key2"], " ", j["key3"] block: var j = parseJson """[1, 2, 3]""" -- cgit 1.4.1-2-gfad0