neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit f4c97da262424e0680e00c5e297da988937480e9
parent 4459e0cee8b6d043ab2b06cbd89545c45a76a612
Author: Joey Gouly <joey.gouly@gmail.com>
Date:   Fri, 12 Apr 2024 17:24:11 +0100

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:
Mtest/unit/strings_spec.lua | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 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)