From 6ed85312ce7f923dfb936000ea87f91d366cc49b Mon Sep 17 00:00:00 2001 From: Alexey Melnichuk Date: Mon, 5 Sep 2016 16:21:12 +0300 Subject: Add. Test to pass lua_Integer as argument --- test/test_integer.lua | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 test/test_integer.lua diff --git a/test/test_integer.lua b/test/test_integer.lua new file mode 100644 index 0000000..b149fd9 --- /dev/null +++ b/test/test_integer.lua @@ -0,0 +1,25 @@ +-- only since Lua 5.3 +if math.type then + + local thread_code = function(...) + local function assert_equal(name, a, b, ...) + if a == b then return b, ... end + print(name .. " Fail! Expected `" .. tostring(a) .. "` got `" .. tostring(b) .. "`") + os.exit(1) + end + + local a,b = ... + assert_equal("1:", 'integer', math.type(a)) + assert_equal("2:", 'float', math.type(b)) + end + + local llthreads = require"llthreads.ex" + + local thread = llthreads.new(thread_code, 10, 20.0 ) + + assert(thread:start()) + + assert(thread:join()) +end + +print("done!") \ No newline at end of file -- cgit v1.2.3-55-g6feb