# HG changeset patch # User Rik # Date 1315076539 25200 # Node ID 756af8385e26b09e69313163b050a1e9d1696687 # Parent 1ca3cde15b18756bd79ee3ccd58c51c50dccfdd9 codesprint: Tests for fail.m fail.m: Add new error tests. diff -r 1ca3cde15b18 -r 756af8385e26 scripts/testfun/fail.m --- a/scripts/testfun/fail.m Sat Sep 03 14:57:12 2011 -0400 +++ b/scripts/testfun/fail.m Sat Sep 03 12:02:19 2011 -0700 @@ -129,15 +129,16 @@ endfunction -%!fail ('[1,2]*[2,3]','nonconformant') -%!fail ("fail('[1,2]*[2;3]','nonconformant')","expected error but got none") -%!fail ("fail('[1,2]*[2,3]','usage:')","expected error \nbut got.*nonconformant") -%!fail ("warning('test warning')",'warning','test warning'); + +%!fail ('[1,2]*[2,3]', 'nonconformant') +%!fail ("fail('[1,2]*[2;3]', 'nonconformant')", "expected error but got none") +%!fail ("fail('[1,2]*[2,3]','usage:')", "expected error \nbut got.*nonconformant") +%!fail ("warning('test warning')", 'warning','test warning'); -%!# fail ("warning('next test')",'warning','next test'); ## only allowed one warning test?!? +##% !fail ("warning('next test')",'warning','next test'); ## only allowed one warning test?!? -## Comment out the following tests if you don't want to see what -## errors look like -% !fail ('a*[2;3]', 'nonconformant') -% !fail ('a*[2,3]', 'usage:') -% !fail ("warning('warning failure')", 'warning', 'success') +%% Test that fail() itself will generate an error +%!error fail ("1"); +%!error fail ('a*[2;3]', 'nonconformant') +%!error fail ('a*[2,3]', 'usage:') +%!error fail ("warning('warning failure')", 'warning', 'success')