From f4c97da262424e0680e00c5e297da988937480e9 Mon Sep 17 00:00:00 2001 From: Joey Gouly Date: Fri, 12 Apr 2024 17:24:11 +0100 Subject: [PATCH] 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 --- test/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 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)