Mercurial > octave
diff test/test_error.m @ 14131:c3309e1ec50d stable
test: Use Octave coding and spacing conventions for fixed test scripts
* build_bc_overload_tests.sh, build_bc_overloads_expected.m,
build_sparse_tests.sh, test_args.m, test_contin.m, test_diag_perm.m,
test_error.m, test_eval-catch.m, test_for.m, test_func.m, test_global.m,
test_if.m, test_index.m, test_io.m, test_logical_index.m, test_null_assign.m,
test_parser.m, test_prefer.m, test_range.m, test_recursion.m, test_return.m,
test_slice.m, test_struct.m, test_switch.m, test_system.m, test_transpose.m,
test_try.m, test_unwind.m, test_while.m:
Use Octave coding and spacing conventions for fixed test scripts.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Sun, 01 Jan 2012 20:04:52 -0800 |
parents | fd0a3ac60b0e |
children | 72c96de7a403 |
line wrap: on
line diff
--- a/test/test_error.m Sun Jan 01 19:17:02 2012 -0500 +++ b/test/test_error.m Sun Jan 01 20:04:52 2012 -0800 @@ -16,68 +16,78 @@ ## along with Octave; see the file COPYING. If not, see ## <http://www.gnu.org/licenses/>. +## Test %!error usage + %% test/octave.test/error/error-1.m %!function g () -%! error ("foo"); +%! error ("foo"); +%!endfunction %!function f () -%! g (); -%!error <foo> f (); +%! g (); +%!endfunction +%!error <foo> f () %% test/octave.test/error/error-2.m %!function g () -%! error ("foo\n"); +%! error ("foo\n"); +%!endfunction %!function f () -%! g -%!error <foo> f (); +%! g +%!endfunction +%!error <foo> f () %% test/octave.test/error/error-3.m -%!error error (); +%!error error () %% test/octave.test/error/error-4.m -%!error <foo> error ("foo\n"); +%!error <foo> error ("foo\n") -%% FIXME Why can't I use %!warning <foo> f; +## Test %!warning usage + %% test/octave.test/error/warning-1.m %!function g () -%! warning ("foo"); +%! warning ("foo"); +%!endfunction %!function f () -%! g; -%!test -%! fail("f","warning","foo"); +%! g; +%!endfunction +%!warning <foo> f () %% test/octave.test/error/warning-2.m %!test %! st.identifier = "backtrace"; -%! ws = warning ("query","backtrace"); -%! warning ("on","backtrace"); +%! ws = warning ("query", "backtrace"); +%! warning ("on", "backtrace"); %! st.state = "on"; -%! assert(warning ("query","backtrace"),st); -%! warning ("off","backtrace"); +%! assert(warning ("query", "backtrace"), st); +%! warning ("off", "backtrace"); %! st.state = "off"; -%! assert(warning ("query","backtrace"),st); -%! warning (ws.state,"backtrace"); +%! assert(warning ("query", "backtrace"), st); +%! warning (ws.state, "backtrace"); -%% FIXME This test no longer makes sense with new warning syntax -%% test/octave.test/error/warning-3.m -%!#warning <foo> warning ("foo", 1); +## Test usage() function %% test/octave.test/error/usage-1.m %!function g () -%! usage ("foo"); +%! usage ("foo"); +%!endfunction %!function f () -%! g (); -%!error <foo> f (); +%! g (); +%!endfunction +%!error <foo> f () %% test/octave.test/error/usage-2.m %!function g () -%! usage ("foo"); +%! usage ("foo"); +%!endfunction %!function f () -%! g -%!error <foo> f (); +%! g +%!endfunction +%!error <foo> f () %% test/octave.test/error/usage-3.m -%!error usage (); +%!error usage () %% test/octave.test/error/usage-4.m -%!error <foo> usage ("foo\n"); +%!error <foo> usage ("foo\n")