Skip to content

Commit 396d4d8

Browse files
committed
Disable JS tests due to: nim-lang/Nim#21317
1 parent 19beb3c commit 396d4d8

File tree

1 file changed

+29
-27
lines changed

1 file changed

+29
-27
lines changed

tests/test_refs.nim

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -11,33 +11,35 @@ var
1111
doAssert a.toJson() == """123"""
1212
doAssert b.toJson() == """null"""
1313

14-
doAssert $(fromJson("""1""", ref int)[]) == "1"
15-
doAssert fromJson("""null""", ref int) == nil
16-
17-
proc check[T](v: T) =
18-
var v2: ref T = newRef(v)
19-
var v3: ref T = nil
20-
doAssert v2.toJson.fromJson(ref T)[] == v2[]
21-
doAssert v3.toJson.fromJson(ref T) == nil
22-
23-
check(1.int)
24-
check(1.int8)
25-
check(1.int16)
26-
check(1.int32)
27-
check(1.int64)
28-
check(1.uint8)
29-
check(1.uint16)
30-
check(1.uint32)
31-
check(1.uint64)
32-
33-
check("hello")
34-
check([1, 2, 3])
35-
check(@[1, 2, 3])
36-
37-
type Entry = object
38-
color: string
39-
40-
check(Entry())
14+
when not defined(js):
15+
# JS has a bug with ref ints: https://github.com/nim-lang/Nim/issues/21317
16+
doAssert $(fromJson("""1""", ref int)[]) == "1"
17+
doAssert fromJson("""null""", ref int) == nil
18+
19+
proc check[T](v: T) =
20+
var v2: ref T = newRef(v)
21+
var v3: ref T = nil
22+
doAssert v2.toJson.fromJson(ref T)[] == v2[]
23+
doAssert v3.toJson.fromJson(ref T) == nil
24+
25+
check(1.int)
26+
check(1.int8)
27+
check(1.int16)
28+
check(1.int32)
29+
check(1.int64)
30+
check(1.uint8)
31+
check(1.uint16)
32+
check(1.uint32)
33+
check(1.uint64)
34+
35+
check("hello")
36+
check([1, 2, 3])
37+
check(@[1, 2, 3])
38+
39+
type Entry = object
40+
color: string
41+
42+
check(Entry())
4143

4244
type
4345
Test = object

0 commit comments

Comments
 (0)