# HG changeset patch # User Rik # Date 1315082593 25200 # Node ID 1dfd4c1d62a3fd53a2cdbc4719fcaff81f2fcc93 # Parent 1bf456b4e51cc4f0f88236eaede6bbdd17fc7a4b codesprint: Tests for ignore_function_time_stamp() in symtab.cc * symtab.cc (ignore_function_time_stamp): Add some set/query tests for internal variable. diff --git a/src/symtab.cc b/src/symtab.cc --- 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\