tests.lua

changeset 18
d6f0c12c152a
parent 8
8c6e74396e22
child 20
1db3ee8b9bc3
equal deleted inserted replaced
17:3a7672943895 18:d6f0c12c152a
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

mercurial