diff options
author | Benoit Germain <benoit.germain@ubisoft.com> | 2024-06-06 17:22:45 +0200 |
---|---|---|
committer | Benoit Germain <benoit.germain@ubisoft.com> | 2024-06-06 17:22:45 +0200 |
commit | 91a34bd09900967e8b9cccdbd6d94a9f8cc8506c (patch) | |
tree | 26ca2e83a6841361ac2d104c9d06bf78edd166e5 /tests | |
parent | d9a149a230f9b320113020789beb78a883da3b40 (diff) | |
download | lanes-91a34bd09900967e8b9cccdbd6d94a9f8cc8506c.tar.gz lanes-91a34bd09900967e8b9cccdbd6d94a9f8cc8506c.tar.bz2 lanes-91a34bd09900967e8b9cccdbd6d94a9f8cc8506c.zip |
lanes.linda("auto")
Diffstat (limited to 'tests')
-rw-r--r-- | tests/basic.lua | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/basic.lua b/tests/basic.lua index 8522895..59b5940 100644 --- a/tests/basic.lua +++ b/tests/basic.lua | |||
@@ -15,7 +15,7 @@ local require_assert_result_1, require_assert_result_2 = require "assert" -- | |||
15 | print("require_assert_result:", require_assert_result_1, require_assert_result_2) | 15 | print("require_assert_result:", require_assert_result_1, require_assert_result_2) |
16 | 16 | ||
17 | local lanes_gen= assert(lanes.gen) | 17 | local lanes_gen= assert(lanes.gen) |
18 | local lanes_linda= assert(lanes.linda) | 18 | local lanes_linda = assert(lanes.linda) |
19 | 19 | ||
20 | local tostring= assert(tostring) | 20 | local tostring= assert(tostring) |
21 | 21 | ||
@@ -160,7 +160,7 @@ PRINT(" "..st) | |||
160 | assert(st == "cancelled", "st is '" .. st .. "' instead of 'cancelled'") | 160 | assert(st == "cancelled", "st is '" .. st .. "' instead of 'cancelled'") |
161 | 161 | ||
162 | -- cancellation of lanes waiting on a linda | 162 | -- cancellation of lanes waiting on a linda |
163 | local limited = lanes.linda("limited") | 163 | local limited = lanes_linda("limited") |
164 | assert.fails(function() limited:limit("key", -1) end) | 164 | assert.fails(function() limited:limit("key", -1) end) |
165 | assert.failsnot(function() limited:limit("key", 1) end) | 165 | assert.failsnot(function() limited:limit("key", 1) end) |
166 | -- [[################################################ | 166 | -- [[################################################ |
@@ -422,6 +422,7 @@ local function chunk2(linda) | |||
422 | -- | 422 | -- |
423 | local info= debug.getinfo(1) -- 1 = us | 423 | local info= debug.getinfo(1) -- 1 = us |
424 | -- | 424 | -- |
425 | PRINT("linda named-> '" ..tostring(linda).."'") | ||
425 | PRINT "debug.getinfo->" | 426 | PRINT "debug.getinfo->" |
426 | for k,v in pairs(info) do PRINT(k,v) end | 427 | for k,v in pairs(info) do PRINT(k,v) end |
427 | 428 | ||
@@ -448,7 +449,7 @@ local function chunk2(linda) | |||
448 | linda:send("up", function() return ":)" end, "ok2") | 449 | linda:send("up", function() return ":)" end, "ok2") |
449 | end | 450 | end |
450 | 451 | ||
451 | local linda= lanes.linda("linda") | 452 | local linda = lanes_linda("auto") |
452 | local t2= lanes_gen("debug,string,io", {gc_cb = gc_cb}, chunk2)(linda) -- prepare & launch | 453 | local t2= lanes_gen("debug,string,io", {gc_cb = gc_cb}, chunk2)(linda) -- prepare & launch |
453 | linda:send("down", function(linda) linda:send("up", "ready!") end, | 454 | linda:send("down", function(linda) linda:send("up", "ready!") end, |
454 | "ok") | 455 | "ok") |