tests.lua

changeset 18
d6f0c12c152a
parent 8
8c6e74396e22
child 20
1db3ee8b9bc3
--- a/tests.lua	Sun Jun 21 23:12:23 2009 +0100
+++ b/tests.lua	Sun Jun 21 23:19:56 2009 +0100
@@ -6,12 +6,16 @@
 
 local all_ok = true;
 
-local function check(input, output)
-	local ret = when(input, 0);
+local function check(input, output, e_start, e_finish)
+	local ret, start, finish = when(input, 0);
 	if ret ~= output then
 		print("FAIL: "..input.." [produces "..ret.."/"..os.date("!%c", ret).."]");
 		all_ok = false;
 		return false;
+	elseif (e_start and e_finish) and (start ~= e_start or finish ~= e_finish) then
+		print("FAIL: "..input.." [uses "..start..","..finish.." instead of "..e_start..","..e_finish.."]");
+		all_ok = false;
+		return false;
 	end
 end
 

mercurial