aboutsummaryrefslogtreecommitdiff
path: root/tests/tobeclosed.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tests/tobeclosed.lua')
-rw-r--r--tests/tobeclosed.lua13
1 files changed, 8 insertions, 5 deletions
diff --git a/tests/tobeclosed.lua b/tests/tobeclosed.lua
index 6e3de4c..5ac8ab7 100644
--- a/tests/tobeclosed.lua
+++ b/tests/tobeclosed.lua
@@ -69,9 +69,10 @@ do
69 69
70 do 70 do
71 71
72 local l_out <close> = l:get("trip") 72 local _, l_out <close> = l:get("trip")
73 end 73 end
74 assert(l_in:get("closed") == true) 74 local _count, _closed = l_in:get("closed")
75 assert(_count == 1 and _closed == true)
75end 76end
76 77
77-- ################################################################################################# 78-- #################################################################################################
@@ -100,7 +101,7 @@ do
100 local lane_body = function(l_arg_) 101 local lane_body = function(l_arg_)
101 WR "In lane body" 102 WR "In lane body"
102 -- linda obtained through a linda 103 -- linda obtained through a linda
103 local l_out <close> = l:get("trip") 104 local _count, l_out <close> = l:get("trip")
104 -- linda from arguments 105 -- linda from arguments
105 local l_arg <close> = l_arg_ 106 local l_arg <close> = l_arg_
106 return true 107 return true
@@ -108,7 +109,8 @@ do
108 109
109 local close_handler_f = function(linda_, err_) 110 local close_handler_f = function(linda_, err_)
110 WR("f closing ", linda_) 111 WR("f closing ", linda_)
111 linda_:set("closed", (linda_:get("closed") or 0) + 1) 112 local _count, _closed = linda_:get("closed")
113 linda_:set("closed", (_closed or 0) + 1)
112 end 114 end
113 local l_in = lanes.linda("voyager", close_handler_f) 115 local l_in = lanes.linda("voyager", close_handler_f)
114 l:set("trip", l_in) 116 l:set("trip", l_in)
@@ -116,7 +118,8 @@ do
116 do 118 do
117 lanes.gen("*", lane_body)(l_in):join() 119 lanes.gen("*", lane_body)(l_in):join()
118 end 120 end
119 assert(l_in:get("closed") == 2) 121 local _count, _closed = l_in:get("closed")
122 assert(_count == 1 and _closed == 2)
120end 123end
121 124
122WR "================================================================================================" 125WR "================================================================================================"