Mercurial > jwe > octave
annotate test/bug-50831/bug-50831.tst @ 28166:ef349f5c320b
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 |
rev | line source |
---|---|
28166
ef349f5c320b
Load structures with arbitrary string fieldnames (bug #50831, bug #46645).
Olaf Till <i7tiol@t-online.de>
parents:
diff
changeset
|
1 %!test |
ef349f5c320b
Load structures with arbitrary string fieldnames (bug #50831, bug #46645).
Olaf Till <i7tiol@t-online.de>
parents:
diff
changeset
|
2 %! filename = "save-text.var"; |
ef349f5c320b
Load structures with arbitrary string fieldnames (bug #50831, bug #46645).
Olaf Till <i7tiol@t-online.de>
parents:
diff
changeset
|
3 %! s.("a-b") = "bad fieldname"; |
ef349f5c320b
Load structures with arbitrary string fieldnames (bug #50831, bug #46645).
Olaf Till <i7tiol@t-online.de>
parents:
diff
changeset
|
4 %! unwind_protect |
ef349f5c320b
Load structures with arbitrary string fieldnames (bug #50831, bug #46645).
Olaf Till <i7tiol@t-online.de>
parents:
diff
changeset
|
5 %! save ("-text", filename, "s"); |
ef349f5c320b
Load structures with arbitrary string fieldnames (bug #50831, bug #46645).
Olaf Till <i7tiol@t-online.de>
parents:
diff
changeset
|
6 %! filevar = load (filename); |
ef349f5c320b
Load structures with arbitrary string fieldnames (bug #50831, bug #46645).
Olaf Till <i7tiol@t-online.de>
parents:
diff
changeset
|
7 %! assert (filevar.s, s); |
ef349f5c320b
Load structures with arbitrary string fieldnames (bug #50831, bug #46645).
Olaf Till <i7tiol@t-online.de>
parents:
diff
changeset
|
8 %! unwind_protect_cleanup |
ef349f5c320b
Load structures with arbitrary string fieldnames (bug #50831, bug #46645).
Olaf Till <i7tiol@t-online.de>
parents:
diff
changeset
|
9 %! sts = unlink (filename); |
ef349f5c320b
Load structures with arbitrary string fieldnames (bug #50831, bug #46645).
Olaf Till <i7tiol@t-online.de>
parents:
diff
changeset
|
10 %! end_unwind_protect |