Comparison

tests/test.lua @ 301:fcb7e63630ae

Warn when subtest function does not exist
author Matthew Wild <mwild1@gmail.com>
date Sat, 15 Nov 2008 23:11:17 +0000
parent 271:396edd2f9d2e
child 337:4a1dd1c2c219
comparison
equal deleted inserted replaced
300:0ebf2ef5124e 301:fcb7e63630ae
69 end 69 end
70 end 70 end
71 end 71 end
72 72
73 function runtest(f, msg) 73 function runtest(f, msg)
74 if not f then print("SUBTEST NOT FOUND: "..(msg or "(no description)")); return; end
74 local success, ret = pcall(f); 75 local success, ret = pcall(f);
75 if success and verbosity >= 2 then 76 if success and verbosity >= 2 then
76 print("SUBTEST PASSED: "..(msg or "(no description)")); 77 print("SUBTEST PASSED: "..(msg or "(no description)"));
77 elseif (not success) and verbosity >= 1 then 78 elseif (not success) and verbosity >= 1 then
78 print("SUBTEST FAILED: "..(msg or "(no description)")); 79 print("SUBTEST FAILED: "..(msg or "(no description)"));