diff options
Diffstat (limited to 'tests/ehynes.lua')
-rw-r--r-- | tests/ehynes.lua | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/ehynes.lua b/tests/ehynes.lua index e203a12..9436c7d 100644 --- a/tests/ehynes.lua +++ b/tests/ehynes.lua | |||
@@ -4,6 +4,11 @@ | |||
4 | local lanes = require "lanes" | 4 | local lanes = require "lanes" |
5 | lanes.configure() | 5 | lanes.configure() |
6 | 6 | ||
7 | local SLEEP = function(...) | ||
8 | local k, v = lanes.sleep(...) | ||
9 | assert(k == nil and v == "timeout") | ||
10 | end | ||
11 | |||
7 | local function PRINT_FMT( fmt, ... ) | 12 | local function PRINT_FMT( fmt, ... ) |
8 | io.stderr:write( string.format(fmt,...).."\n" ) | 13 | io.stderr:write( string.format(fmt,...).."\n" ) |
9 | end | 14 | end |
@@ -36,7 +41,7 @@ local receiver2 = receiver_gen('another message') | |||
36 | 41 | ||
37 | -- a function to pause and log the execution for debugging | 42 | -- a function to pause and log the execution for debugging |
38 | local function logf(s, f, ...) | 43 | local function logf(s, f, ...) |
39 | linda:receive(1, "dummy") -- wait 1s | 44 | SLEEP(1) |
40 | PRINT_FMT( "*** %s", s ) | 45 | PRINT_FMT( "*** %s", s ) |
41 | f(...) | 46 | f(...) |
42 | end | 47 | end |