4 print("No 'when' function ?!"); |
4 print("No 'when' function ?!"); |
5 end |
5 end |
6 |
6 |
7 local all_ok = true; |
7 local all_ok = true; |
8 |
8 |
9 local function check(input, output) |
9 local function check(input, output, e_start, e_finish) |
10 local ret = when(input, 0); |
10 local ret, start, finish = when(input, 0); |
11 if ret ~= output then |
11 if ret ~= output then |
12 print("FAIL: "..input.." [produces "..ret.."/"..os.date("!%c", ret).."]"); |
12 print("FAIL: "..input.." [produces "..ret.."/"..os.date("!%c", ret).."]"); |
|
13 all_ok = false; |
|
14 return false; |
|
15 elseif (e_start and e_finish) and (start ~= e_start or finish ~= e_finish) then |
|
16 print("FAIL: "..input.." [uses "..start..","..finish.." instead of "..e_start..","..e_finish.."]"); |
13 all_ok = false; |
17 all_ok = false; |
14 return false; |
18 return false; |
15 end |
19 end |
16 end |
20 end |
17 |
21 |