annotate test/struct.tst @ 16659:608e307b4914 ss-3-7-5

snapshot 3.7.5 * configure.ac (OCTAVE_VERSION): Bump to 3.7.5.
author John W. Eaton <jwe@octave.org>
date Tue, 14 May 2013 05:23:45 -0400
parents b1283d4c06c2
children 57fad64de019
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
14138
72c96de7a403 maint: update copyright notices for 2012
John W. Eaton <jwe@octave.org>
parents: 14131
diff changeset
1 ## Copyright (C) 2006-2012 John W. Eaton
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5751
diff changeset
2 ##
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5751
diff changeset
3 ## This file is part of Octave.
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5751
diff changeset
4 ##
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5751
diff changeset
5 ## Octave is free software; you can redistribute it and/or modify it
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5751
diff changeset
6 ## under the terms of the GNU General Public License as published by
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5751
diff changeset
7 ## the Free Software Foundation; either version 3 of the License, or (at
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5751
diff changeset
8 ## your option) any later version.
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5751
diff changeset
9 ##
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5751
diff changeset
10 ## Octave is distributed in the hope that it will be useful, but
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5751
diff changeset
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5751
diff changeset
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5751
diff changeset
13 ## General Public License for more details.
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5751
diff changeset
14 ##
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5751
diff changeset
15 ## You should have received a copy of the GNU General Public License
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5751
diff changeset
16 ## along with Octave; see the file COPYING. If not, see
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5751
diff changeset
17 ## <http://www.gnu.org/licenses/>.
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5751
diff changeset
18
5590
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
19 %% test/octave.test/struct/fieldnames-1.m
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
20 %!test
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
21 %! s.a = 1;
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
22 %! c = fieldnames (s);
14131
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
23 %! assert (iscell (c) && strcmp (c{1}, "a"));
5590
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
24
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
25 %% test/octave.test/struct/fieldnames-2.m
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
26 %!test
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
27 %! s.a.b = 1;
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
28 %! c = fieldnames (s.a);
14131
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
29 %! assert (iscell (c) && strcmp (c{1}, "b"));
5590
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
30
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
31 %% test/octave.test/struct/fieldnames-3.m
13915
5fa482628bf6 Remove unnecessary regular expression '.*' from ends of %!error blocks
Rik <octave@nomad.inbox5.com>
parents: 11523
diff changeset
32 %!error <Invalid call to fieldnames> fieldnames ();
5590
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
33
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
34 %% test/octave.test/struct/fieldnames-4.m
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
35 %!test
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
36 %! s.a = 1;
14131
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
37 %! fail ("fieldnames (s, 1)", "Invalid call to fieldnames");
5590
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
38
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
39 %% test/octave.test/struct/fieldnames-5.m
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
40 %!error fieldnames (1);
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
41
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
42 %% test/octave.test/struct/isfield-1.m
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
43 %!test
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
44 %! s.aaa = 1;
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
45 %! s.a = 2;
14131
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
46 %! assert (isfield (s, "a"));
5590
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
47
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
48 %% test/octave.test/struct/isfield-2.m
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
49 %!test
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
50 %! s.aaa = 1;
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
51 %! s.a = 2;
14131
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
52 %! assert (!(isfield (s, "b")));
5590
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
53
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
54 %% test/octave.test/struct/isfield-3.m
13915
5fa482628bf6 Remove unnecessary regular expression '.*' from ends of %!error blocks
Rik <octave@nomad.inbox5.com>
parents: 11523
diff changeset
55 %!error <Invalid call to isfield> isfield ();
5590
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
56
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
57 %% test/octave.test/struct/isfield-4.m
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
58 %!test
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
59 %! s.aaa = 1;
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
60 %! s.a = 2;
14131
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
61 %! fail ("isfield (s, 'a', 3);", "Invalid call to isfield");
5590
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
62
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
63 %% test/octave.test/struct/isfield-5.m
14131
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
64 %!assert (isfield (1, "m") == 0);
5590
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
65
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
66 %% test/octave.test/struct/isfield-6.m
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
67 %!test
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
68 %! s.a = 2;
14131
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
69 %! assert (isfield (s, 2) == 0);
5590
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
70
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
71 %% test/octave.test/struct/isstruct-1.m
14131
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
72 %!assert (!(isstruct (1)))
5590
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
73
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
74 %% test/octave.test/struct/isstruct-2.m
14131
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
75 %!assert (!(isstruct ([1, 2])))
5590
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
76
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
77 %% test/octave.test/struct/isstruct-3.m
14131
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
78 %!assert (!(isstruct ([])))
5590
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
79
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
80 %% test/octave.test/struct/isstruct-4.m
14131
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
81 %!assert (!(isstruct ([1, 2; 3, 4])))
5590
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
82
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
83 %% test/octave.test/struct/isstruct-5.m
14131
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
84 %!assert (!(isstruct ("t")))
5590
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
85
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
86 %% test/octave.test/struct/isstruct-6.m
14131
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
87 %!assert (!(isstruct ("test")))
5590
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
88
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
89 %% test/octave.test/struct/isstruct-7.m
14131
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
90 %!assert (!(isstruct (["test"; "ing"])))
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
91
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
92 %!assert (!(isstruct ({1})))
5590
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
93
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
94 %% test/octave.test/struct/isstruct-8.m
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
95 %!test
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
96 %! s.a = 1;
14131
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
97 %! assert (isstruct (s));
5590
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
98
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
99 %% test/octave.test/struct/isstruct-9.m
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
100 %!test
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
101 %! s.a.b = 1;
14131
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
102 %! assert (isstruct (s.a));
5590
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
103
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
104 %% test/octave.test/struct/isstruct-10.m
13915
5fa482628bf6 Remove unnecessary regular expression '.*' from ends of %!error blocks
Rik <octave@nomad.inbox5.com>
parents: 11523
diff changeset
105 %!error <Invalid call to isstruct> isstruct ();
5590
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
106
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
107 %% test/octave.test/struct/isstruct-11.m
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
108 %!test
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
109 %! s.a = 1;
14131
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
110 %! fail ("isstruct (s, 1)", "Invalid call to isstruct");
5590
1ad66ea35fe5 [project @ 2006-01-06 00:24:05 by jwe]
jwe
parents:
diff changeset
111
8603
4c68e26e3ba1 Add tests to prevent regression of struct array indexing
Thorsten Meyer <thorsten.meyier@gmx.de>
parents: 7017
diff changeset
112 ## increment element of matrix stored in struct array field
4c68e26e3ba1 Add tests to prevent regression of struct array indexing
Thorsten Meyer <thorsten.meyier@gmx.de>
parents: 7017
diff changeset
113 %!test
14131
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
114 %! a = struct ("c", {[1, 2, 3], [4, 5, 6], [7, 8, 9]});
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
115 %! a(2).c(3)++;
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
116 %! assert (a(2).c, [4, 5, 7]);
8603
4c68e26e3ba1 Add tests to prevent regression of struct array indexing
Thorsten Meyer <thorsten.meyier@gmx.de>
parents: 7017
diff changeset
117
4c68e26e3ba1 Add tests to prevent regression of struct array indexing
Thorsten Meyer <thorsten.meyier@gmx.de>
parents: 7017
diff changeset
118 ## create struct array by assignment to cs-list
4c68e26e3ba1 Add tests to prevent regression of struct array indexing
Thorsten Meyer <thorsten.meyier@gmx.de>
parents: 7017
diff changeset
119 %!test
14131
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
120 %! [a(1:2).x] = deal (1, 3);
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
121 %! assert (a, struct ("x", {1, 3}));
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
122 %! assert ({a(1:2).x}, {1, 3});
8603
4c68e26e3ba1 Add tests to prevent regression of struct array indexing
Thorsten Meyer <thorsten.meyier@gmx.de>
parents: 7017
diff changeset
123
4c68e26e3ba1 Add tests to prevent regression of struct array indexing
Thorsten Meyer <thorsten.meyier@gmx.de>
parents: 7017
diff changeset
124 ## assign to subrange of struct array field
4c68e26e3ba1 Add tests to prevent regression of struct array indexing
Thorsten Meyer <thorsten.meyier@gmx.de>
parents: 7017
diff changeset
125 %!test
14131
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
126 %! b = struct ("name", {"a", "b", "c"; "d", "e", "f"}, "value", 100);
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
127 %! [b(1:2, [1,3]).name] = deal ("aaa", "ddd", "ccc", "fff");
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
128 %! assert ({b.name}, {"aaa", "ddd", "b", "e", "ccc", "fff"});
8603
4c68e26e3ba1 Add tests to prevent regression of struct array indexing
Thorsten Meyer <thorsten.meyier@gmx.de>
parents: 7017
diff changeset
129
4c68e26e3ba1 Add tests to prevent regression of struct array indexing
Thorsten Meyer <thorsten.meyier@gmx.de>
parents: 7017
diff changeset
130 ## index into nested struct arrays
4c68e26e3ba1 Add tests to prevent regression of struct array indexing
Thorsten Meyer <thorsten.meyier@gmx.de>
parents: 7017
diff changeset
131 %!test
14131
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
132 %! a = struct ("name", {"a", "b", "c"; "d", "e", "f"}, "value", 0);
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
133 %! a(2).value = a;
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
134 %! assert (a(2).value(2,3).name, "f");
8603
4c68e26e3ba1 Add tests to prevent regression of struct array indexing
Thorsten Meyer <thorsten.meyier@gmx.de>
parents: 7017
diff changeset
135
4c68e26e3ba1 Add tests to prevent regression of struct array indexing
Thorsten Meyer <thorsten.meyier@gmx.de>
parents: 7017
diff changeset
136 ## assign to subrange of field in nested struct array
4c68e26e3ba1 Add tests to prevent regression of struct array indexing
Thorsten Meyer <thorsten.meyier@gmx.de>
parents: 7017
diff changeset
137 %!test
14131
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
138 %! b = struct ("name", {"a", "b", "c"; "d", "e", "f"}, "value", 0);
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
139 %! b(3, 1).value = b;
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
140 %! [b(3, 1).value(1, [1, 3]).name] = deal ("aaa", "ccc");
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
141 %! assert (size (b), [3, 3]);
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
142 %! assert (b(3,1).value(1, 3).name, "ccc");
8603
4c68e26e3ba1 Add tests to prevent regression of struct array indexing
Thorsten Meyer <thorsten.meyier@gmx.de>
parents: 7017
diff changeset
143
14131
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
144 ## test 4-dimensional struct array
8603
4c68e26e3ba1 Add tests to prevent regression of struct array indexing
Thorsten Meyer <thorsten.meyier@gmx.de>
parents: 7017
diff changeset
145 %!test
14131
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
146 %! c(4, 4, 4, 4).name = "a";
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
147 %! c(3, 3, 3, 3).value = 1;
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
148 %! assert (c(2,2,2,2), struct ("name", [], "value", []));
8603
4c68e26e3ba1 Add tests to prevent regression of struct array indexing
Thorsten Meyer <thorsten.meyier@gmx.de>
parents: 7017
diff changeset
149
14131
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
150 ## assign to subrange of field in 4D struct array
8603
4c68e26e3ba1 Add tests to prevent regression of struct array indexing
Thorsten Meyer <thorsten.meyier@gmx.de>
parents: 7017
diff changeset
151 %!test
14131
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
152 %! c(4, 4, 4, 4).name = "a";
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
153 %! c(3, 3, 3, 3).value = 1;
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
154 %! [c([1, 3], 2, :, [3, 4]).value] = deal (1);
16213
b1283d4c06c2 test: Use Octave coding standards for scripts in test/ directory.
Rik <rik@octave.org>
parents: 16030
diff changeset
155 %! assert (length (find ([c.value] == 1)), 17);
b1283d4c06c2 test: Use Octave coding standards for scripts in test/ directory.
Rik <rik@octave.org>
parents: 16030
diff changeset
156 %! assert (length (find ([c.value])), 17);
8603
4c68e26e3ba1 Add tests to prevent regression of struct array indexing
Thorsten Meyer <thorsten.meyier@gmx.de>
parents: 7017
diff changeset
157
4c68e26e3ba1 Add tests to prevent regression of struct array indexing
Thorsten Meyer <thorsten.meyier@gmx.de>
parents: 7017
diff changeset
158 ## swap elements of struct array
4c68e26e3ba1 Add tests to prevent regression of struct array indexing
Thorsten Meyer <thorsten.meyier@gmx.de>
parents: 7017
diff changeset
159 %!test
14131
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
160 %! b = struct ("name", {"a", "b", "c"; "d", "e", "f"}, "value", 0);
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
161 %! [b([2, 1], [3, 1]).name] = deal (b([1, 2], [1, 2]).name);
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
162 %! assert ({b.name}, {"e", "b", "b", "e", "d", "a"});
8603
4c68e26e3ba1 Add tests to prevent regression of struct array indexing
Thorsten Meyer <thorsten.meyier@gmx.de>
parents: 7017
diff changeset
163
4c68e26e3ba1 Add tests to prevent regression of struct array indexing
Thorsten Meyer <thorsten.meyier@gmx.de>
parents: 7017
diff changeset
164 ## test internal ordering of struct array fields
4c68e26e3ba1 Add tests to prevent regression of struct array indexing
Thorsten Meyer <thorsten.meyier@gmx.de>
parents: 7017
diff changeset
165 %!test
14131
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
166 %! c(4, 4, 4, 4).value = 3;
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
167 %! c(1, 2, 3, 4).value = 2;
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
168 %! c(3, 3, 3, 3).value = 1;
16213
b1283d4c06c2 test: Use Octave coding standards for scripts in test/ directory.
Rik <rik@octave.org>
parents: 16030
diff changeset
169 %! d = reshape ({c.value}, size (c));
14131
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
170 %! assert ([d{4, 4, 4, 4}, d{1, 2, 3, 4}, d{3, 3, 3, 3}],
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
171 %! [3, 2, 1]);
8603
4c68e26e3ba1 Add tests to prevent regression of struct array indexing
Thorsten Meyer <thorsten.meyier@gmx.de>
parents: 7017
diff changeset
172
4c68e26e3ba1 Add tests to prevent regression of struct array indexing
Thorsten Meyer <thorsten.meyier@gmx.de>
parents: 7017
diff changeset
173 ## test assignment to mixed cs-list of field element subranges
4c68e26e3ba1 Add tests to prevent regression of struct array indexing
Thorsten Meyer <thorsten.meyier@gmx.de>
parents: 7017
diff changeset
174 %!test
14131
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
175 %! b = struct ("name", {"a", "b", "c"; "d", "e", "f"}, "value", 100);
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
176 %! [b(1:2, [1, 3]).name, b(2, 1:3).value] = ...
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
177 %! deal (1, 2, 3, 4, "5", "6", "7");
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
178 %! assert ({b.name}, {1, 2, "b", "e", 3, 4});
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
179 %! assert ({b.value}, {100, "5", 100, "6", 100, "7"});
8603
4c68e26e3ba1 Add tests to prevent regression of struct array indexing
Thorsten Meyer <thorsten.meyier@gmx.de>
parents: 7017
diff changeset
180
4c68e26e3ba1 Add tests to prevent regression of struct array indexing
Thorsten Meyer <thorsten.meyier@gmx.de>
parents: 7017
diff changeset
181 %!error <a cs-list cannot be further indexed>
14131
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
182 %! [a(1:3).x] = deal ([1, 5], [3, 7], [8, 9]);
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
183 %! [a(2:3).x(2)] = deal (10, 11);
8603
4c68e26e3ba1 Add tests to prevent regression of struct array indexing
Thorsten Meyer <thorsten.meyier@gmx.de>
parents: 7017
diff changeset
184
10588
c1111769f595 test_struct: update expected error message text
John W. Eaton <jwe@octave.org>
parents: 10399
diff changeset
185 %!error <a cs-list cannot be further indexed>
14131
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
186 %! [a(1:3).x] = deal ([1, 5], [3, 7], [8, 9]);
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
187 %! a(2:3).x(2);
8603
4c68e26e3ba1 Add tests to prevent regression of struct array indexing
Thorsten Meyer <thorsten.meyier@gmx.de>
parents: 7017
diff changeset
188
10399
81bcdf5fd7a9 modernize failing tests
Jaroslav Hajek <highegg@gmail.com>
parents: 10366
diff changeset
189 %!error id=Octave:index-out-of-bounds
14131
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
190 %! a(1).x.x = 1;
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
191 %! a(2).x;
8603
4c68e26e3ba1 Add tests to prevent regression of struct array indexing
Thorsten Meyer <thorsten.meyier@gmx.de>
parents: 7017
diff changeset
192
4c68e26e3ba1 Add tests to prevent regression of struct array indexing
Thorsten Meyer <thorsten.meyier@gmx.de>
parents: 7017
diff changeset
193 %!error <invalid number of output arguments for constant expression>
14131
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
194 %! a = struct ("value", {1, 2, 3, 4, 5});
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
195 %! [a(2:4).value] = 1;
8603
4c68e26e3ba1 Add tests to prevent regression of struct array indexing
Thorsten Meyer <thorsten.meyier@gmx.de>
parents: 7017
diff changeset
196
4c68e26e3ba1 Add tests to prevent regression of struct array indexing
Thorsten Meyer <thorsten.meyier@gmx.de>
parents: 7017
diff changeset
197 %!error <invalid assignment to cs-list outside multiple assignment>
14131
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
198 %! c(4, 4, 4, 4).name = "a";
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
199 %! c(3, 3, 3, 3).value = 1;
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
200 %! c([1, 3], 2, :, [3, 4]).value = 1;
8603
4c68e26e3ba1 Add tests to prevent regression of struct array indexing
Thorsten Meyer <thorsten.meyier@gmx.de>
parents: 7017
diff changeset
201
9122
8ca06fd9c6ef test lazy copying in structures
Thorsten Meyer <thorsten.meyier@gmx.de>
parents: 9112
diff changeset
202 ## test lazy copying in structs: nested assignment to self
8ca06fd9c6ef test lazy copying in structures
Thorsten Meyer <thorsten.meyier@gmx.de>
parents: 9112
diff changeset
203 %!test
14131
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
204 %! a.a = 1;
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
205 %! a.b = a;
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
206 %! a.b.c = a;
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
207 %! assert (a.b.c.b, struct ("a", 1));
9122
8ca06fd9c6ef test lazy copying in structures
Thorsten Meyer <thorsten.meyier@gmx.de>
parents: 9112
diff changeset
208
8ca06fd9c6ef test lazy copying in structures
Thorsten Meyer <thorsten.meyier@gmx.de>
parents: 9112
diff changeset
209 ## test lazy copying in structs: indirect nested assignment to self
8ca06fd9c6ef test lazy copying in structures
Thorsten Meyer <thorsten.meyier@gmx.de>
parents: 9112
diff changeset
210 %!test
14131
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
211 %! a.a = 1;
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
212 %! a.b = 2;
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
213 %! b.c = a;
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
214 %! b.d = 3;
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
215 %! c.d = b;
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
216 %! c.e = 4;
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
217 %! a.b = c;
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
218 %! a.b.e = a;
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
219 %! assert (a.b.e.b.d.c, struct ("a", 1, "b", 2));
9122
8ca06fd9c6ef test lazy copying in structures
Thorsten Meyer <thorsten.meyier@gmx.de>
parents: 9112
diff changeset
220
8ca06fd9c6ef test lazy copying in structures
Thorsten Meyer <thorsten.meyier@gmx.de>
parents: 9112
diff changeset
221 ## test lazy copying in structs: nested assignment via function
8ca06fd9c6ef test lazy copying in structures
Thorsten Meyer <thorsten.meyier@gmx.de>
parents: 9112
diff changeset
222 %!function aa = do_nest (a);
8ca06fd9c6ef test lazy copying in structures
Thorsten Meyer <thorsten.meyier@gmx.de>
parents: 9112
diff changeset
223 %! aa = a;
8ca06fd9c6ef test lazy copying in structures
Thorsten Meyer <thorsten.meyier@gmx.de>
parents: 9112
diff changeset
224 %! aa.b = a;
14131
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
225 %!endfunction
9122
8ca06fd9c6ef test lazy copying in structures
Thorsten Meyer <thorsten.meyier@gmx.de>
parents: 9112
diff changeset
226 %!test
14131
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
227 %! a.c = 1;
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
228 %! a = do_nest (a);
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
229 %! a = do_nest (a);
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
230 %! a = do_nest (a);
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
231 %! assert (a.b.b.b, struct ("c", 1));
9122
8ca06fd9c6ef test lazy copying in structures
Thorsten Meyer <thorsten.meyier@gmx.de>
parents: 9112
diff changeset
232
8ca06fd9c6ef test lazy copying in structures
Thorsten Meyer <thorsten.meyier@gmx.de>
parents: 9112
diff changeset
233 ## test lazy copying in structs: nested assignment via function
8ca06fd9c6ef test lazy copying in structures
Thorsten Meyer <thorsten.meyier@gmx.de>
parents: 9112
diff changeset
234 %!function aa = do_nest (a);
8ca06fd9c6ef test lazy copying in structures
Thorsten Meyer <thorsten.meyier@gmx.de>
parents: 9112
diff changeset
235 %! aa = a;
8ca06fd9c6ef test lazy copying in structures
Thorsten Meyer <thorsten.meyier@gmx.de>
parents: 9112
diff changeset
236 %! aa.b = a;
8ca06fd9c6ef test lazy copying in structures
Thorsten Meyer <thorsten.meyier@gmx.de>
parents: 9112
diff changeset
237 %! aa.b.c = aa;
14131
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
238 %!endfunction
9122
8ca06fd9c6ef test lazy copying in structures
Thorsten Meyer <thorsten.meyier@gmx.de>
parents: 9112
diff changeset
239 %!test
14131
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
240 %! a.c = 1;
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
241 %! a = do_nest (a);
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
242 %! a = do_nest (a);
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
243 %! a = do_nest (a);
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
244 %! assert (a.b.c.b.b.c.b.b.c.b, struct ("c", 1));
9122
8ca06fd9c6ef test lazy copying in structures
Thorsten Meyer <thorsten.meyier@gmx.de>
parents: 9112
diff changeset
245
8ca06fd9c6ef test lazy copying in structures
Thorsten Meyer <thorsten.meyier@gmx.de>
parents: 9112
diff changeset
246 ## test lazy copying in structs: nested assignment on different levels.
8ca06fd9c6ef test lazy copying in structures
Thorsten Meyer <thorsten.meyier@gmx.de>
parents: 9112
diff changeset
247 %!test
14131
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
248 %! a.b = 1;
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
249 %! b.c = a;
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
250 %! b.d.e = a;
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
251 %! b.f.g.h = a;
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
252 %! b.i.j.k.l = a;
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
253 %! a.m = b;
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
254 %! a.m.c.b = a;
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
255 %! assert (a.m.c.b.m.i.j.k.l, struct ("b", 1));
9130
67fa54583fe8 Add test to prevent regression of empty struct assignment bug
Thorsten Meyer <thorsten.meyier@gmx.de>
parents: 9122
diff changeset
256
67fa54583fe8 Add test to prevent regression of empty struct assignment bug
Thorsten Meyer <thorsten.meyier@gmx.de>
parents: 9122
diff changeset
257 ## test indexed assignment into empty struct array
67fa54583fe8 Add test to prevent regression of empty struct assignment bug
Thorsten Meyer <thorsten.meyier@gmx.de>
parents: 9122
diff changeset
258 %!test
14131
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
259 %! s = resize (struct (), 3,2);
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
260 %! s(3).foo = 42;
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
261 %! assert (s(3), struct ("foo", 42));
9130
67fa54583fe8 Add test to prevent regression of empty struct assignment bug
Thorsten Meyer <thorsten.meyier@gmx.de>
parents: 9122
diff changeset
262
10399
81bcdf5fd7a9 modernize failing tests
Jaroslav Hajek <highegg@gmail.com>
parents: 10366
diff changeset
263 %!error id=Octave:index-out-of-bounds
14131
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
264 %! s = resize (struct (),3,2);
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
265 %! s(3).foo = 42;
c3309e1ec50d test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents: 13915
diff changeset
266 %! s(7);