aboutsummaryrefslogtreecommitdiff
path: root/unit_tests/scripts/lane/tasking_basic.lua
diff options
context:
space:
mode:
authorBenoit Germain <benoit.germain@ubisoft.com>2025-06-24 08:53:36 +0200
committerBenoit Germain <benoit.germain@ubisoft.com>2025-06-24 08:53:36 +0200
commit41dcaf101368350a49e756abc41f3e9c3c22ec66 (patch)
treeff3e072f027f56feb6e2187c800abfa3386a5431 /unit_tests/scripts/lane/tasking_basic.lua
parentb9f17d8a10c8508a893b0e86000128e0dbf2a146 (diff)
downloadlanes-41dcaf101368350a49e756abc41f3e9c3c22ec66.tar.gz
lanes-41dcaf101368350a49e756abc41f3e9c3c22ec66.tar.bz2
lanes-41dcaf101368350a49e756abc41f3e9c3c22ec66.zip
Move some tests to a separate script
Diffstat (limited to 'unit_tests/scripts/lane/tasking_basic.lua')
-rw-r--r--unit_tests/scripts/lane/tasking_basic.lua27
1 files changed, 0 insertions, 27 deletions
diff --git a/unit_tests/scripts/lane/tasking_basic.lua b/unit_tests/scripts/lane/tasking_basic.lua
index 7a22307..233accf 100644
--- a/unit_tests/scripts/lane/tasking_basic.lua
+++ b/unit_tests/scripts/lane/tasking_basic.lua
@@ -15,33 +15,6 @@ local lanes_linda = assert(lanes.linda)
15-- ################################################################################################## 15-- ##################################################################################################
16-- ################################################################################################## 16-- ##################################################################################################
17 17
18-- we can create a generator where the lane body is a C function
19do
20 local b, g = pcall(lanes.gen, "*", print)
21 assert(b == true and type(g) == "function")
22 -- we can start the lane
23 local b, h = pcall(g, "hello")
24 -- the lane runs normally
25 h:join()
26 assert(h.status == "done")
27end
28
29-- we can create a generator where the lane body is a C function that raises an error
30do
31 local b, g = pcall(lanes.gen, "*", error)
32 assert(b == true and type(g) == "function")
33 -- we can start the lane
34 local b, h = pcall(g, "this is an error")
35 -- this provides the error that occurred in the lane
36 local s, e, t = h:join()
37 assert(h.status == "error")
38 assert(s == nil and e == "this is an error" and t == nil)
39end
40
41-- ##################################################################################################
42-- ##################################################################################################
43-- ##################################################################################################
44
45local function task(a, b, c) 18local function task(a, b, c)
46 local new_name = "task("..a..","..b..","..c..")" 19 local new_name = "task("..a..","..b..","..c..")"
47 -- test lane naming change 20 -- test lane naming change