aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/test_logger.lua22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/test_logger.lua b/test/test_logger.lua
new file mode 100644
index 0000000..66c190f
--- /dev/null
+++ b/test/test_logger.lua
@@ -0,0 +1,22 @@
1require "llthreads".new([[
2require "string"
3
4require "llthreads".set_logger(function(msg)
5 if type(msg) ~= 'string' then
6 print("ERROR! Invalid error message: ", msg)
7 os.exit(-2)
8 end
9 if not msg:find("SOME ERROR", nil, true) then
10 print("ERROR! Invalid error message: ", msg)
11 os.exit(-1)
12 end
13 print("Done!")
14 os.exit(0)
15end)
16
17error("SOME ERROR")
18]]):start():join()
19
20print("ERROR! Logger has not been call!")
21os.exit(-1)
22