diff options
author | Benoit Germain <benoit.germain@ubisoft.com> | 2024-03-28 11:09:02 +0100 |
---|---|---|
committer | Benoit Germain <benoit.germain@ubisoft.com> | 2024-03-28 11:09:02 +0100 |
commit | dce4fbc640fc41241c77aaf31da51b8fcc0f11d9 (patch) | |
tree | a0bdf4412bc7556c0b1c24f1e5f401c1960eb8c4 /tests/keeper.lua | |
parent | caf556e2dcb3df4992dd386a2b37535df42fc880 (diff) | |
download | lanes-dce4fbc640fc41241c77aaf31da51b8fcc0f11d9.tar.gz lanes-dce4fbc640fc41241c77aaf31da51b8fcc0f11d9.tar.bz2 lanes-dce4fbc640fc41241c77aaf31da51b8fcc0f11d9.zip |
C++ migration: less kludgy Linda name management with a std::variant
Diffstat (limited to '')
-rw-r--r-- | tests/keeper.lua | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/keeper.lua b/tests/keeper.lua index 11bbe17..9b38f02 100644 --- a/tests/keeper.lua +++ b/tests/keeper.lua | |||
@@ -6,6 +6,14 @@ | |||
6 | 6 | ||
7 | local lanes = require "lanes".configure{ with_timers = false, nb_keepers = 200} | 7 | local lanes = require "lanes".configure{ with_timers = false, nb_keepers = 200} |
8 | 8 | ||
9 | do | ||
10 | print "Linda names test:" | ||
11 | local unnamedLinda = lanes.linda() | ||
12 | local unnamedLinda2 = lanes.linda("") | ||
13 | local veeeerrrryyyylooongNamedLinda= lanes.linda( "veeeerrrryyyylooongNamedLinda", 1) | ||
14 | print(unnamedLinda, unnamedLinda2, veeeerrrryyyylooongNamedLinda) | ||
15 | end | ||
16 | |||
9 | local print_id = 0 | 17 | local print_id = 0 |
10 | local PRINT = function(...) | 18 | local PRINT = function(...) |
11 | print_id = print_id + 1 | 19 | print_id = print_id + 1 |
@@ -33,6 +41,7 @@ local B= keeper( lindaB ) | |||
33 | 41 | ||
34 | local lindaC= lanes.linda( "C", 3) | 42 | local lindaC= lanes.linda( "C", 3) |
35 | local C= keeper( lindaC ) | 43 | local C= keeper( lindaC ) |
44 | print("Created", lindaA, lindaB, lindaC) | ||
36 | 45 | ||
37 | A.some= 1 | 46 | A.some= 1 |
38 | PRINT("A.some == " .. A.some ) | 47 | PRINT("A.some == " .. A.some ) |