Comparison

tests/test.lua @ 787:c4a4d5604549

Small fix to change verbosity level of subtests
author Matthew Wild <mwild1@gmail.com>
date Wed, 11 Feb 2009 19:50:58 +0000
parent 760:90ce865eebd8
child 808:ce39abe0259a
comparison
equal deleted inserted replaced
786:f2dc6118b3f4 787:c4a4d5604549
161 function runtest(f, msg) 161 function runtest(f, msg)
162 if not f then print("SUBTEST NOT FOUND: "..(msg or "(no description)")); return; end 162 if not f then print("SUBTEST NOT FOUND: "..(msg or "(no description)")); return; end
163 local success, ret = pcall(f); 163 local success, ret = pcall(f);
164 if success and verbosity >= 2 then 164 if success and verbosity >= 2 then
165 print("SUBTEST PASSED: "..(msg or "(no description)")); 165 print("SUBTEST PASSED: "..(msg or "(no description)"));
166 elseif (not success) and verbosity >= 1 then 166 elseif (not success) and verbosity >= 0 then
167 print("SUBTEST FAILED: "..(msg or "(no description)")); 167 print("SUBTEST FAILED: "..(msg or "(no description)"));
168 error(ret, 0); 168 error(ret, 0);
169 end 169 end
170 end 170 end
171 171