diff options
Diffstat (limited to '')
-rw-r--r-- | tests/basic.lua | 3 | ||||
-rw-r--r-- | tests/errhangtest.lua | 5 |
2 files changed, 6 insertions, 2 deletions
diff --git a/tests/basic.lua b/tests/basic.lua index 85a9889..68a7e2a 100644 --- a/tests/basic.lua +++ b/tests/basic.lua | |||
@@ -155,7 +155,8 @@ assert(st == "cancelled") | |||
155 | 155 | ||
156 | -- cancellation of lanes waiting on a linda | 156 | -- cancellation of lanes waiting on a linda |
157 | local limited = lanes.linda("limited") | 157 | local limited = lanes.linda("limited") |
158 | limited:limit("key", 1) | 158 | assert.fails(function() limited:limit("key", 0) end) |
159 | assert.failsnot(function() limited:limit("key", 1) end) | ||
159 | -- [[################################################ | 160 | -- [[################################################ |
160 | limited:send("key", "hello") -- saturate linda | 161 | limited:send("key", "hello") -- saturate linda |
161 | for k, v in pairs(limited:dump()) do | 162 | for k, v in pairs(limited:dump()) do |
diff --git a/tests/errhangtest.lua b/tests/errhangtest.lua index 811601e..84de8c6 100644 --- a/tests/errhangtest.lua +++ b/tests/errhangtest.lua | |||
@@ -39,7 +39,10 @@ if true then | |||
39 | print(pcall(linda.send, linda, 'test', t_in)) | 39 | print(pcall(linda.send, linda, 'test', t_in)) |
40 | local k,t_out = linda:receive('test') -- read the contents successfully sent | 40 | local k,t_out = linda:receive('test') -- read the contents successfully sent |
41 | t_out.fun() | 41 | t_out.fun() |
42 | -- TODO: t_out should contain a single entry, as [fun] = fun should have been discarded because functions are not acceptable keys | 42 | -- t_out should contain a single entry, as [fun] = fun should have been discarded because functions are not acceptable keys |
43 | local count = 0 | ||
44 | for k,v in pairs(t_out) do count = count + 1 end | ||
45 | assert(count == 1) | ||
43 | print "OK" | 46 | print "OK" |
44 | end | 47 | end |
45 | 48 | ||