Mercurial > octave
diff test/bug-50831/bug-50831.tst @ 28179:bea3f8f96f7a stable
Load structures with arbitrary string fieldnames (bug #50831, bug #46645).
* ls-oct-text.h, ls-oct-text.cc (read_text_data): Consider additional optional
bool argument to skip validation of input name.
* ov-struct.cc (octave_struct::load_ascii, octave_scalar_struct::load_ascii):
Call read_text_data with additional argument (skip_validation), set to true.
* test/bug-50831/bug-50831.tst, test/bug-50831/module.mk: New test files.
author | Olaf Till <i7tiol@t-online.de> |
---|---|
date | Wed, 19 Apr 2017 15:06:31 +0200 |
parents | |
children | 6beb610b3bcd |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/bug-50831/bug-50831.tst Wed Apr 19 15:06:31 2017 +0200 @@ -0,0 +1,10 @@ +%!test +%! filename = "save-text.var"; +%! s.("a-b") = "bad fieldname"; +%! unwind_protect +%! save ("-text", filename, "s"); +%! filevar = load (filename); +%! assert (filevar.s, s); +%! unwind_protect_cleanup +%! sts = unlink (filename); +%! end_unwind_protect