From add78d673a63a63c191bb2c8f563dc3ea06565e1 Mon Sep 17 00:00:00 2001 From: routersys Date: Sat, 27 Jun 2026 09:33:33 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=AF=E3=83=AD=E3=82=B9=E3=82=A8=E3=83=B3?= =?UTF-8?q?=E3=82=B8=E3=83=B3=E8=A9=95=E4=BE=A1=E3=83=A9=E3=83=B3=E3=83=8A?= =?UTF-8?q?=E3=83=BC=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LuaScript.Tests/native/runner.lua | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 LuaScript.Tests/native/runner.lua diff --git a/LuaScript.Tests/native/runner.lua b/LuaScript.Tests/native/runner.lua new file mode 100644 index 0000000..ecda303 --- /dev/null +++ b/LuaScript.Tests/native/runner.lua @@ -0,0 +1,25 @@ +local shimPath = arg[1] +local vectorsPath = arg[2] + +assert(loadfile(shimPath))() + +local f = assert(io.open(vectorsPath, "r")) +local out = {} +for line in f:lines() do + local chunk = loadstring("return " .. line) + if not chunk then + out[#out + 1] = "ERROR" + else + local ok, res = pcall(chunk) + if not ok then + out[#out + 1] = "ERROR" + elseif type(res) == "boolean" then + out[#out + 1] = res and "true" or "false" + else + out[#out + 1] = string.format("%.17g", res) + end + end +end +f:close() + +io.write(table.concat(out, "\n"))