diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/test_threads_attr.lua | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/test_threads_attr.lua b/test/test_threads_attr.lua new file mode 100644 index 0000000..fbcb036 --- /dev/null +++ b/test/test_threads_attr.lua | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | local llthreads = require"llthreads.ex" | ||
| 2 | |||
| 3 | local thread = llthreads.new(function() return 1 end) | ||
| 4 | |||
| 5 | assert(not thread:started()) | ||
| 6 | |||
| 7 | -- thread is not started so this is not valid values | ||
| 8 | assert(not thread:detached()) | ||
| 9 | assert(not thread:joinable()) | ||
| 10 | |||
| 11 | assert(thread:start(true, true)) | ||
| 12 | |||
| 13 | assert(thread:detached()) | ||
| 14 | assert(thread:joinable()) | ||
| 15 | |||
| 16 | assert(thread:join()) | ||
| 17 | |||
| 18 | assert(thread:started()) | ||
| 19 | assert(not thread:alive()) | ||
| 20 | |||
| 21 | print("done!") \ No newline at end of file | ||
