Mercurial > hg > octave-nkf
changeset 13078:1dfd4c1d62a3
codesprint: Tests for ignore_function_time_stamp() in symtab.cc
* symtab.cc (ignore_function_time_stamp): Add some set/query tests for internal variable.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Sat, 03 Sep 2011 13:43:13 -0700 |
parents | 1bf456b4e51c |
children | 9512d7272d5b |
files | src/symtab.cc |
diffstat | 1 files changed, 20 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/symtab.cc +++ b/src/symtab.cc @@ -1463,7 +1463,7 @@ { octave_value retval; - if (nargout > 0) + if (nargout > 0 || nargin == 0) { switch (Vignore_function_time_stamp) { @@ -1507,6 +1507,25 @@ return retval; } +/* +%!shared old_state +%! old_state = ignore_function_time_stamp (); +%!test +%! state = ignore_function_time_stamp ("all"); +%! assert (state, old_state); +%! assert (ignore_function_time_stamp (), "all"); +%! state = ignore_function_time_stamp ("system"); +%! assert (state, "all"); +%! assert (ignore_function_time_stamp (), "system"); +%! ignore_function_time_stamp (old_state); + +%% Test input validation +%!error (ignore_function_time_stamp ("all", "all")) +%!error (ignore_function_time_stamp ("UNKNOWN_VALUE")) +%!error (ignore_function_time_stamp (42)) + +*/ + DEFUN (__current_scope__, , , "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {[@var{scope}, @var{context}]} __dump_symtab_info__ ()\n\