From d534bfc9586c1260d3255f949b7aa6f48511af3a Mon Sep 17 00:00:00 2001 From: osch Date: Tue, 4 Sep 2018 21:59:23 +0200 Subject: avoid NULL as parameter to lua_concat in llthread_log --- test/test_error.lua | 40 ++++++++++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 8 deletions(-) (limited to 'test') diff --git a/test/test_error.lua b/test/test_error.lua index 1407ea8..341105e 100644 --- a/test/test_error.lua +++ b/test/test_error.lua @@ -5,13 +5,37 @@ local include = utils.thread_init .. [[ local llthreads = require"llthreads" ]] -local thread = llthreads.new(include .. [[ - error({}) -]]) - -thread:start() -local ok, err = thread:join() -print(ok, err) -assert(not ok) +do + local thread = llthreads.new(include .. [[ + error({}) + ]]) + + thread:start() + local ok, err = thread:join() + print(ok, err) + assert(not ok) +end +do + local thread = llthreads.new(include .. [[ + llthreads.set_logger(function(msg) print("XXX", msg) end) + error({}) + ]]) + + thread:start() + local ok, err = thread:join() + print(ok, err) + assert(not ok) +end +do + local thread = llthreads.new(include .. [[ + llthreads.set_logger(function(msg) end) + error({}) + ]]) + + thread:start() + local ok, err = thread:join() + print(ok, err) + assert(not ok) +end print("Done!") -- cgit v1.2.3-55-g6feb