summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorflywind <43030857+xflywind@users.noreply.github.com>2020-12-30 08:06:50 -0600
committerGitHub <noreply@github.com>2020-12-30 15:06:50 +0100
commit73f778e441cd4229af4115f762bd597a8a20fb74 (patch)
tree09403d69507d77d576d77cb90932fc6d412d1c7f
parent84a7544988ffd8d26ff50c8a9417acbededf03fb (diff)
downloadNim-73f778e441cd4229af4115f762bd597a8a20fb74.tar.gz
follow #16505 move and active tests (#16508)
* fix printing negative zero in JS backend

* move tests
-rw-r--r--tests/misc/tnegativezero.nim30
-rw-r--r--tests/system/tdollars.nim26
2 files changed, 26 insertions, 30 deletions
diff --git a/tests/misc/tnegativezero.nim b/tests/misc/tnegativezero.nim
deleted file mode 100644
index a443e40cf..000000000
--- a/tests/misc/tnegativezero.nim
+++ /dev/null
@@ -1,30 +0,0 @@
-discard """
-  targets: "c cpp js"
-"""
-
-proc main()=
-  block:
-    let a = -0.0
-    doAssert $a == "-0.0"
-    doAssert $(-0.0) == "-0.0"
-
-  block:
-    let a = 0.0
-    when nimvm: discard ## TODO VM print wrong -0.0
-    else:
-      doAssert $a == "0.0"
-    doAssert $(0.0) == "0.0"
-
-  block:
-    let b = -0
-    doAssert $b == "0"
-    doAssert $(-0) == "0"
-
-  block:
-    let b = 0
-    doAssert $b == "0"
-    doAssert $(0) == "0"
-
-
-static: main()
-main()
diff --git a/tests/system/tdollars.nim b/tests/system/tdollars.nim
index 6ddec911f..1b2602ad0 100644
--- a/tests/system/tdollars.nim
+++ b/tests/system/tdollars.nim
@@ -77,3 +77,29 @@ block: # #14350 for JS
   doAssert cstr == nil
   doAssert cstr.isNil
   doAssert cstr != cstring("")
+
+
+proc main()=
+  block:
+    let a = -0.0
+    doAssert $a == "-0.0"
+    doAssert $(-0.0) == "-0.0"
+
+  block:
+    let a = 0.0
+    doAssert $a == "0.0"
+    doAssert $(0.0) == "0.0"
+
+  block:
+    let b = -0
+    doAssert $b == "0"
+    doAssert $(-0) == "0"
+
+  block:
+    let b = 0
+    doAssert $b == "0"
+    doAssert $(0) == "0"
+
+
+static: main()
+main()