aboutsummaryrefslogtreecommitdiff
path: root/unit_tests/scripts/lane/tasking_communications.lua
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--unit_tests/scripts/lane/tasking_communications.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/unit_tests/scripts/lane/tasking_communications.lua b/unit_tests/scripts/lane/tasking_communications.lua
index b922973..01842b4 100644
--- a/unit_tests/scripts/lane/tasking_communications.lua
+++ b/unit_tests/scripts/lane/tasking_communications.lua
@@ -72,7 +72,7 @@ local chunk= function(linda)
72 WR("chunk ", "Lane ends!\n") 72 WR("chunk ", "Lane ends!\n")
73end 73end
74 74
75local linda = lanes_linda("communications") 75local linda = lanes_linda{name = "communications"}
76assert(type(linda) == "userdata" and tostring(linda) == "Linda: communications") 76assert(type(linda) == "userdata" and tostring(linda) == "Linda: communications")
77 -- 77 --
78 -- ["->"] master -> slave 78 -- ["->"] master -> slave
@@ -90,7 +90,7 @@ local b,x,y,z,w = linda:get("<->", 4)
90assert(b == 3 and x == "x" and y == "y" and z == "z" and w == nil) 90assert(b == 3 and x == "x" and y == "y" and z == "z" and w == nil)
91local k, x = linda:receive("<->") 91local k, x = linda:receive("<->")
92assert(k == "<->" and x == "x") 92assert(k == "<->" and x == "x")
93local k,y,z = linda:receive(linda.batched, "<->", 2) 93local k,y,z = linda:receive_batched("<->", 2)
94assert(k == "<->" and y == "y" and z == "z") 94assert(k == "<->" and y == "y" and z == "z")
95linda:set("<->") 95linda:set("<->")
96local b,x,y,z,w = linda:get("<->", 4) 96local b,x,y,z,w = linda:get("<->", 4)
@@ -101,7 +101,7 @@ local function PEEK(...) return linda:get("<-", ...) end
101local function SEND(...) local _res, _err = linda:send("->", ...) assert(_res == true and _err == nil) end 101local function SEND(...) local _res, _err = linda:send("->", ...) assert(_res == true and _err == nil) end
102local function RECEIVE() local k,v = linda:receive(1, "<-") return v end 102local function RECEIVE() local k,v = linda:receive(1, "<-") return v end
103 103
104local comms_lane = lanes_gen("io", {gc_cb = gc_cb, name = "auto"}, chunk)(linda) -- prepare & launch 104local comms_lane = lanes_gen("io", { name = 'auto', gc_cb = gc_cb }, chunk)(linda) -- prepare & launch
105 105
106SEND(1); WR("main ", "1 sent\n") 106SEND(1); WR("main ", "1 sent\n")
107SEND(2); WR("main ", "2 sent\n") 107SEND(2); WR("main ", "2 sent\n")