mirror of
https://github.com/neovim/neovim
synced 2025-07-15 16:51:49 +00:00
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
This commit is contained in:
@ -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)
|
||||
|
||||
|
Reference in New Issue
Block a user