summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-05-22 01:16:02 +1000
committerdaurnimator <quae@daurnimator.com>2017-05-22 01:16:02 +1000
commit64c25a472882364e12e1f42bd8c02e26e7895d55 (patch)
treee73809629c8e91a81725642705ad05144f14775c /tests
parent44779c34305ddc5aa7bf271851f916c6680cdb44 (diff)
downloadfengari-64c25a472882364e12e1f42bd8c02e26e7895d55.tar.gz
fengari-64c25a472882364e12e1f42bd8c02e26e7895d55.tar.bz2
fengari-64c25a472882364e12e1f42bd8c02e26e7895d55.zip
tests/test-suite/inprogress/math.js: isNaN is a shared function for tests
Diffstat (limited to 'tests')
-rw-r--r--tests/test-suite/inprogress/math.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/test-suite/inprogress/math.js b/tests/test-suite/inprogress/math.js
index 776fa3c..ae3ec7a 100644
--- a/tests/test-suite/inprogress/math.js
+++ b/tests/test-suite/inprogress/math.js
@@ -16,6 +16,10 @@ const prefix = `
local intbits = math.floor(math.log(maxint, 2) + 0.5) + 1
--assert((1 << intbits) == 0)
+ local function isNaN (x)
+ return (x ~= x)
+ end
+
local function checkerror (msg, f, ...)
local s, err = pcall(f, ...)
assert(not s and string.find(err, msg))
@@ -81,9 +85,6 @@ test("[test-suite] math: number of bits in the mantissa of a floating-point numb
end
end
- local function isNaN (x)
- return (x ~= x)
- end
assert(isNaN(0/0))
assert(not isNaN(1/0))