aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/test_integer.lua25
1 files changed, 25 insertions, 0 deletions
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 @@
1-- only since Lua 5.3
2if math.type then
3
4 local thread_code = function(...)
5 local function assert_equal(name, a, b, ...)
6 if a == b then return b, ... end
7 print(name .. " Fail! Expected `" .. tostring(a) .. "` got `" .. tostring(b) .. "`")
8 os.exit(1)
9 end
10
11 local a,b = ...
12 assert_equal("1:", 'integer', math.type(a))
13 assert_equal("2:", 'float', math.type(b))
14 end
15
16 local llthreads = require"llthreads.ex"
17
18 local thread = llthreads.new(thread_code, 10, 20.0 )
19
20 assert(thread:start())
21
22 assert(thread:join())
23end
24
25print("done!") \ No newline at end of file