Skip to content

Commit 8561c65

Browse files
committed
Remove float test and make table keys flexible.
1 parent 401f49a commit 8561c65

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

tests/test_tojson.nim

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,13 @@ doAssert 1.uint32.toJson() == "1"
99
doAssert 1.int8.toJson() == "1"
1010
doAssert 1.int16.toJson() == "1"
1111
doAssert 1.int32.toJson() == "1"
12-
doAssert 3.14.float64.toJson() == "3.14"
12+
1313

1414
when not defined(js):
1515
doAssert 1.int64.toJson() == "1"
1616
doAssert 1.uint64.toJson() == "1"
17-
doAssert 3.14.float32.toJson() == "3.140000104904175"
1817

1918
match 1
20-
match 3.14.float32
21-
match 3.14.float64
2219

2320
doAssert [1, 2, 3].toJson() == "[1,2,3]"
2421
doAssert @[1, 2, 3].toJson() == "[1,2,3]"
@@ -65,7 +62,7 @@ doAssert t.toJson() == """[1,2.2,"hi"]"""
6562
var tb: Table[string, int]
6663
tb["hi"] = 1
6764
tb["bye"] = 2
68-
doAssert tb.toJson() == """{"hi":1,"bye":2}"""
65+
doAssert tb.toJson() == """{"hi":1,"bye":2}""" or tb.toJson() == """{"bye":2,"hi":1}"""
6966

7067
type Fraction = object
7168
numerator: int

0 commit comments

Comments
 (0)