summary refs log tree commit diff stats
path: root/tests/system/tdollars.nim
diff options
context:
space:
mode:
authormetagn <metagngn@gmail.com>2023-04-11 22:20:20 +0300
committerGitHub <noreply@github.com>2023-04-11 21:20:20 +0200
commitf05387045df55bf7123ee68002238e943716815e (patch)
tree9ba7959434162830612e31351eadbae79cf3bc37 /tests/system/tdollars.nim
parentbe06446ffecd7665651a25d6b07fade5cc019296 (diff)
downloadNim-f05387045df55bf7123ee68002238e943716815e.tar.gz
int64/uint64 as bigint in JS (#21613)
* int64/uint64 as bigint in JS

* fix CI

* convert to compile option

* fix lie

* smaller diff, changelog entry
Diffstat (limited to 'tests/system/tdollars.nim')
-rw-r--r--tests/system/tdollars.nim10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/system/tdollars.nim b/tests/system/tdollars.nim
index 93fa5cb9e..7eb26cd6b 100644
--- a/tests/system/tdollars.nim
+++ b/tests/system/tdollars.nim
@@ -1,5 +1,5 @@
 discard """
-  targets: "c cpp js"
+  matrix: "; --backend:cpp; --backend:js --jsbigint64:off; --backend:js --jsbigint64:on"
 """
 
 #[
@@ -12,6 +12,7 @@ duplication (which always results in weaker test coverage in practice).
 ]#
 
 import std/unittest
+import std/private/jsutils
 template test[T](a: T, expected: string) =
   check $a == expected
   var b = a
@@ -66,7 +67,8 @@ block: # `$`(SomeInteger)
   testType int
   testType bool
 
-  when not defined(js): # requires BigInt support
+  whenJsNoBigInt64: discard
+  do:
     testType uint64
     testType int64
     testType BiggestInt
@@ -176,10 +178,10 @@ proc main()=
       res.addInt int64(i)
     doAssert res == "-9-8-7-6-5-4-3-2-10"
 
-    when not defined(js):
+    whenJsNoBigInt64: discard
+    do:
       test2 high(int64), "9223372036854775807"
       test2 low(int64), "-9223372036854775808"
-
     test2 high(int32), "2147483647"
     test2 low(int32), "-2147483648"
     test2 high(int16), "32767"