[Tarantool-patches] [PATCH luajit 4/4] test: add test for gh-6163 min/max

Maxim Kokryashkin max.kokryashkin at gmail.com
Thu Sep 23 16:55:28 MSK 2021


math.min()/math.max() could produce different results when compiled. The
issue is fixed in vanilla LuaJIT and was backported in 210d511. This
patch adds test case for the mentioned issue.

Closes tarantool/tarantool#6163
---
 .../gh-6163-jit-min-max.test.lua               | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 test/tarantool-tests/gh-6163-jit-min-max.test.lua

diff --git a/test/tarantool-tests/gh-6163-jit-min-max.test.lua b/test/tarantool-tests/gh-6163-jit-min-max.test.lua
new file mode 100644
index 00000000..0e68a2e5
--- /dev/null
+++ b/test/tarantool-tests/gh-6163-jit-min-max.test.lua
@@ -0,0 +1,18 @@
+local tap = require('tap')
+
+local test = tap.test("gh-6163-jit-min-max")
+test:plan(2)
+--
+-- gh-6163: math.min/math.max success with no args
+--
+local pcall = pcall
+
+jit.opt.start(0, 'hotloop=1')
+
+local r, msg = pcall(function() math.min() end)
+test:ok(false == r)
+r, msg = pcall(function() math.min() end)
+test:ok(false == r)
+
+os.exit(test:check() and 0 or 1)
+
-- 
2.33.0



More information about the Tarantool-patches mailing list