From: Vsevolod Stakhov Date: Sat, 6 Dec 2025 08:49:57 +0000 (+0000) Subject: [Test] Fix selector tests to work with both LuaJIT and Lua 5.4 X-Git-Tag: 3.14.2~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=898212b45821abb76805bec4673a43585322eb4e;p=thirdparty%2Frspamd.git [Test] Fix selector tests to work with both LuaJIT and Lua 5.4 Use tostring() for expected values so they match the runtime's float-to-string conversion (LuaJIT: "1", Lua 5.4: "1.0") --- diff --git a/test/lua/unit/selectors.lua b/test/lua/unit/selectors.lua index 1266a90521..437014fe2f 100644 --- a/test/lua/unit/selectors.lua +++ b/test/lua/unit/selectors.lua @@ -230,11 +230,11 @@ context("Selectors test", function() ["pool_var double"] = { selector = [[pool_var("int_var", 'double')]], - expect = {"1.0"}}, + expect = {tostring(1.0)}}, ["time"] = { selector = "time", - expect = {"1537364211.0"}}, + expect = {tostring(1537364211.0)}}, -- ["request_header"] = { -- selector = "request_header(hdr1)",