changeset 25464:c0bca26d0713

maint: Merge stable to default.
author John W. Eaton <jwe@octave.org>
date Tue, 12 Jun 2018 15:08:07 -0400
parents 6011085a9d7c (current diff) 1c4ffd4f9404 (diff)
children 26164f8a734a
files libinterp/corefcn/variables.cc
diffstat 1 files changed, 19 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/variables.cc	Tue Jun 12 11:26:57 2018 -0700
+++ b/libinterp/corefcn/variables.cc	Tue Jun 12 15:08:07 2018 -0400
@@ -1497,7 +1497,7 @@
 
           // Set up temporary scope.
 
-          octave::symbol_scope tmp_scope;
+          octave::symbol_scope tmp_scope ("$dummy_scope$");
 
           symtab.set_scope (tmp_scope);
 
@@ -1702,6 +1702,24 @@
   return do_who (interp, argc, argv, nargout == 1);
 }
 
+/*
+%!test
+%! avar = magic (4);
+%! ftmp = [tempname() ".mat"];
+%! unwind_protect
+%!   save (ftmp, "avar");
+%!   vars = whos ("-file", ftmp);
+%!   assert (numel (vars), 1);
+%!   assert (isstruct (vars));
+%!   assert (vars.name, "avar");
+%!   assert (vars.size, [4, 4]);
+%!   assert (vars.class, "double");
+%!   assert (vars.bytes, 128);
+%! unwind_protect_cleanup
+%!   unlink (ftmp);
+%! end_unwind_protect
+*/
+
 DEFMETHOD (whos, interp, args, nargout,
            doc: /* -*- texinfo -*-
 @deftypefn  {} {} whos