follow #16505 move and active tests (#16508)

* fix printing negative zero in JS backend

* move tests
This commit is contained in:
flywind
2020-12-30 08:06:50 -06:00
committed by GitHub
parent 84a7544988
commit 73f778e441
2 changed files with 26 additions and 30 deletions

View File

@@ -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()

View File

@@ -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()