aboutsummaryrefslogtreecommitdiff
path: root/test/unit/strings_spec.lua
diff options
context:
space:
mode:
authorJoey Gouly <joey.gouly@gmail.com>2024-04-12 17:24:11 +0100
committerJoey Gouly <joey.gouly@gmail.com>2024-04-12 17:37:57 +0100
commitf4c97da262424e0680e00c5e297da988937480e9 (patch)
tree275004ec818080e04261dcde9101ecc4840ddc31 /test/unit/strings_spec.lua
parent4459e0cee8b6d043ab2b06cbd89545c45a76a612 (diff)
downloadrneovim-f4c97da262424e0680e00c5e297da988937480e9.tar.gz
rneovim-f4c97da262424e0680e00c5e297da988937480e9.tar.bz2
rneovim-f4c97da262424e0680e00c5e297da988937480e9.zip
fix(test): fix strings_spec.lua for AArch64
LuaJIT does not handle -0.0 correctly in 'dual number mode' (which is the default, and only supported mode for LuaJIT arm64). If LuaJIT is forced to use 'dual number mode' on X64 (where the default is single), this test will fail in the same manner. Fix this by using tonumber("-0.0") instead of a -0.0 literal. See: https://github.com/LuaJIT/LuaJIT/issues/858
Diffstat (limited to 'test/unit/strings_spec.lua')
-rw-r--r--test/unit/strings_spec.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/unit/strings_spec.lua b/test/unit/strings_spec.lua
index 6e88f5141d..25cdc27b28 100644
--- a/test/unit/strings_spec.lua
+++ b/test/unit/strings_spec.lua
@@ -188,7 +188,7 @@ describe('vim_snprintf()', function()
a('nan', buf, bsize, '%f', 0.0 / 0.0)
a('inf', buf, bsize, '%f', 1.0 / 0.0)
a('-inf', buf, bsize, '%f', -1.0 / 0.0)
- a('-0.000000', buf, bsize, '%f', -0.0)
+ a('-0.000000', buf, bsize, '%f', tonumber('-0.0'))
a('漢語', buf, bsize, '%s', '漢語')
a(' 漢語', buf, bsize, '%8s', '漢語')
a('漢語 ', buf, bsize, '%-8s', '漢語')
@@ -233,7 +233,7 @@ describe('vim_snprintf()', function()
a('nan', buf, bsize, '%1$f', 0.0 / 0.0)
a('inf', buf, bsize, '%1$f', 1.0 / 0.0)
a('-inf', buf, bsize, '%1$f', -1.0 / 0.0)
- a('-0.000000', buf, bsize, '%1$f', -0.0)
+ a('-0.000000', buf, bsize, '%1$f', tonumber('-0.0'))
end
end)