fixes testament matrix doesn't work with other backends which left many JS tests untested (#23592)

Targets are not changes, which means the C binary is actually tested for
JS backend
This commit is contained in:
ringabout
2024-05-14 17:33:08 +08:00
committed by GitHub
parent 81a937ce1f
commit 04f3df4c87
6 changed files with 34 additions and 11 deletions

View File

@@ -31,7 +31,8 @@ block hashes:
doAssert hashWangYi1(123) == wy123
const wyNeg123 = hashWangYi1(-123)
doAssert wyNeg123 != 0
doAssert hashWangYi1(-123) == wyNeg123
when not defined(js): # TODO: fixme it doesn't work for JS
doAssert hashWangYi1(-123) == wyNeg123
# "hashIdentity value incorrect at 456"

View File

@@ -297,6 +297,9 @@ block: # bug #22360
inc fc
when defined(js):
doAssert (tc, fc) == (483, 517), $(tc, fc)
when compileOption("jsbigint64"):
doAssert (tc, fc) == (517, 483), $(tc, fc)
else:
doAssert (tc, fc) == (515, 485), $(tc, fc)
else:
doAssert (tc, fc) == (510, 490), $(tc, fc)

View File

@@ -527,9 +527,9 @@ template main() =
block: # toHex
doAssert(toHex(100i16, 32) == "00000000000000000000000000000064")
doAssert(toHex(-100i16, 32) == "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9C")
whenJsNoBigInt64: discard
do:
doAssert(toHex(-100i16, 32) == "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9C")
doAssert(toHex(high(uint64)) == "FFFFFFFFFFFFFFFF")
doAssert(toHex(high(uint64), 16) == "FFFFFFFFFFFFFFFF")
doAssert(toHex(high(uint64), 32) == "0000000000000000FFFFFFFFFFFFFFFF")