diff options
Diffstat (limited to '')
-rw-r--r-- | unit_tests/scripts/lane/tasking_communications.lua | 6 |
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") |
73 | end | 73 | end |
74 | 74 | ||
75 | local linda = lanes_linda("communications") | 75 | local linda = lanes_linda{name = "communications"} |
76 | assert(type(linda) == "userdata" and tostring(linda) == "Linda: communications") | 76 | assert(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) | |||
90 | assert(b == 3 and x == "x" and y == "y" and z == "z" and w == nil) | 90 | assert(b == 3 and x == "x" and y == "y" and z == "z" and w == nil) |
91 | local k, x = linda:receive("<->") | 91 | local k, x = linda:receive("<->") |
92 | assert(k == "<->" and x == "x") | 92 | assert(k == "<->" and x == "x") |
93 | local k,y,z = linda:receive(linda.batched, "<->", 2) | 93 | local k,y,z = linda:receive_batched("<->", 2) |
94 | assert(k == "<->" and y == "y" and z == "z") | 94 | assert(k == "<->" and y == "y" and z == "z") |
95 | linda:set("<->") | 95 | linda:set("<->") |
96 | local b,x,y,z,w = linda:get("<->", 4) | 96 | local b,x,y,z,w = linda:get("<->", 4) |
@@ -101,7 +101,7 @@ local function PEEK(...) return linda:get("<-", ...) end | |||
101 | local function SEND(...) local _res, _err = linda:send("->", ...) assert(_res == true and _err == nil) end | 101 | local function SEND(...) local _res, _err = linda:send("->", ...) assert(_res == true and _err == nil) end |
102 | local function RECEIVE() local k,v = linda:receive(1, "<-") return v end | 102 | local function RECEIVE() local k,v = linda:receive(1, "<-") return v end |
103 | 103 | ||
104 | local comms_lane = lanes_gen("io", {gc_cb = gc_cb, name = "auto"}, chunk)(linda) -- prepare & launch | 104 | local comms_lane = lanes_gen("io", { name = 'auto', gc_cb = gc_cb }, chunk)(linda) -- prepare & launch |
105 | 105 | ||
106 | SEND(1); WR("main ", "1 sent\n") | 106 | SEND(1); WR("main ", "1 sent\n") |
107 | SEND(2); WR("main ", "2 sent\n") | 107 | SEND(2); WR("main ", "2 sent\n") |