changeset 12833:9f0f2c226053

codesprint: new tests for functions in pt-eval.cc * pt-eval.cc (Fmax_recursion_depth, Fsilent_functions): New tests.
author John W. Eaton <jwe@octave.org>
date Sat, 16 Jul 2011 17:29:00 -0400
parents 03f125c0fb7b
children a12569d5906e
files src/pt-eval.cc
diffstat 1 files changed, 22 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/pt-eval.cc	Sat Jul 16 17:24:02 2011 -0400
+++ b/src/pt-eval.cc	Sat Jul 16 17:29:00 2011 -0400
@@ -1202,6 +1202,17 @@
   return SET_INTERNAL_VARIABLE (max_recursion_depth);
 }
 
+/*
+%!error (max_recursion_depth (1, 2));
+%!test
+%! orig_val = max_recursion_depth ();
+%! old_val = max_recursion_depth (2*orig_val);
+%! assert (orig_val, old_val);
+%! assert (max_recursion_depth (), 2*orig_val);
+%! max_recursion_depth (orig_val);
+%! assert (max_recursion_depth (), orig_val);
+*/
+
 DEFUN (silent_functions, args, nargout,
   "-*- texinfo -*-\n\
 @deftypefn  {Built-in Function} {@var{val} =} silent_functions ()\n\
@@ -1214,3 +1225,14 @@
 {
   return SET_INTERNAL_VARIABLE (silent_functions);
 }
+
+/*
+%!error (silent_functions (1, 2));
+%!test
+%! orig_val = silent_functions ();
+%! old_val = silent_functions (! orig_val);
+%! assert (orig_val, old_val);
+%! assert (silent_functions (), ! orig_val);
+%! silent_functions (orig_val);
+%! assert (silent_functions (), orig_val);
+*/