aboutsummaryrefslogtreecommitdiff
path: root/tests/basic.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tests/basic.lua')
-rw-r--r--tests/basic.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/basic.lua b/tests/basic.lua
index a9c85cc..9aaad97 100644
--- a/tests/basic.lua
+++ b/tests/basic.lua
@@ -163,7 +163,7 @@ PRINT(" "..st)
163assert(st == "cancelled", "st is '" .. st .. "' instead of 'cancelled'") 163assert(st == "cancelled", "st is '" .. st .. "' instead of 'cancelled'")
164 164
165-- cancellation of lanes waiting on a linda 165-- cancellation of lanes waiting on a linda
166local limited = lanes_linda("limited") 166local limited = lanes_linda{name = "limited"}
167assert.fails(function() limited:limit("key", -1) end) 167assert.fails(function() limited:limit("key", -1) end)
168assert.failsnot(function() limited:limit("key", 1) end) 168assert.failsnot(function() limited:limit("key", 1) end)
169-- [[################################################ 169-- [[################################################
@@ -255,7 +255,7 @@ local chunk= function(linda)
255 WR("chunk ", "Lane ends!\n") 255 WR("chunk ", "Lane ends!\n")
256end 256end
257 257
258local linda = lanes_linda("communications") 258local linda = lanes_linda{name = "communications"}
259assert(type(linda) == "userdata" and tostring(linda) == "Linda: communications") 259assert(type(linda) == "userdata" and tostring(linda) == "Linda: communications")
260 -- 260 --
261 -- ["->"] master -> slave 261 -- ["->"] master -> slave
@@ -410,7 +410,7 @@ local tc = lanes.gen("io", { name = 'auto', gc_cb = gc_cb },
410 end 410 end
411) 411)
412 412
413local linda= lanes_linda("criss cross") 413local linda= lanes_linda{name = "criss cross"}
414 414
415local a,b= tc(linda, "A","B"), tc(linda, "B","A") -- launching two lanes, twisted comms 415local a,b= tc(linda, "A","B"), tc(linda, "B","A") -- launching two lanes, twisted comms
416 416
@@ -461,7 +461,7 @@ local function chunk2(linda)
461 linda:send("up", function() return ":)" end, "ok2") 461 linda:send("up", function() return ":)" end, "ok2")
462end 462end
463 463
464local linda = lanes_linda("auto") 464local linda = lanes_linda{name = "auto"}
465local t2 = lanes.gen("debug,string,io", { name = 'auto', gc_cb = gc_cb }, chunk2)(linda) -- prepare & launch 465local t2 = lanes.gen("debug,string,io", { name = 'auto', gc_cb = gc_cb }, chunk2)(linda) -- prepare & launch
466linda:send("down", function(linda) linda:send("up", "ready!") end, 466linda:send("down", function(linda) linda:send("up", "ready!") end,
467 "ok") 467 "ok")