Mercurial > octave
annotate test/null-assign.tst @ 31221:f5755dbacd8d
maint: merge stable to default
author | Pantxo Diribarne <pantxo.diribarne@gmail.com> |
---|---|
date | Wed, 31 Aug 2022 22:04:02 +0200 |
parents | 796f54d4ddbf |
children | 597f3ee61a48 |
rev | line source |
---|---|
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
1 ######################################################################## |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
2 ## |
30564
796f54d4ddbf
update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents:
29358
diff
changeset
|
3 ## Copyright (C) 2008-2022 The Octave Project Developers |
27918
b442ec6dda5c
use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
4 ## |
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
5 ## See the file COPYRIGHT.md in the top-level directory of this |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
6 ## distribution or <https://octave.org/copyright/>. |
8119
acfd80c08d60
make null assignment more Matlab-compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
7 ## |
acfd80c08d60
make null assignment more Matlab-compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
8 ## This file is part of Octave. |
acfd80c08d60
make null assignment more Matlab-compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
9 ## |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
10 ## Octave is free software: you can redistribute it and/or modify it |
8119
acfd80c08d60
make null assignment more Matlab-compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
11 ## under the terms of the GNU General Public License as published by |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
12 ## the Free Software Foundation, either version 3 of the License, or |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22439
diff
changeset
|
13 ## (at your option) any later version. |
8119
acfd80c08d60
make null assignment more Matlab-compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
14 ## |
acfd80c08d60
make null assignment more Matlab-compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
15 ## Octave is distributed in the hope that it will be useful, but |
acfd80c08d60
make null assignment more Matlab-compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
16 ## WITHOUT ANY WARRANTY; without even the implied warranty of |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22439
diff
changeset
|
17 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22439
diff
changeset
|
18 ## GNU General Public License for more details. |
8119
acfd80c08d60
make null assignment more Matlab-compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
19 ## |
acfd80c08d60
make null assignment more Matlab-compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
20 ## You should have received a copy of the GNU General Public License |
acfd80c08d60
make null assignment more Matlab-compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
21 ## along with Octave; see the file COPYING. If not, see |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
22 ## <https://www.gnu.org/licenses/>. |
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
23 ## |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
24 ######################################################################## |
8119
acfd80c08d60
make null assignment more Matlab-compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
25 |
acfd80c08d60
make null assignment more Matlab-compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
26 %!test |
21580
ecce63c99c3f
maint: Add semicolons to terminate code in %! blocks.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
27 %! a = 1:3; a(:) = []; assert (size (a), [0, 0]); |
8119
acfd80c08d60
make null assignment more Matlab-compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
28 %!test |
21580
ecce63c99c3f
maint: Add semicolons to terminate code in %! blocks.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
29 %! a = 1:3; a(1:3) = []; assert (size (a), [1, 0]); |
8119
acfd80c08d60
make null assignment more Matlab-compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
30 %!test |
21580
ecce63c99c3f
maint: Add semicolons to terminate code in %! blocks.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
31 %! a = (1:3).'; a(1:3) = []; assert (size (a), [0, 1]); |
8119
acfd80c08d60
make null assignment more Matlab-compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
32 %!test |
21580
ecce63c99c3f
maint: Add semicolons to terminate code in %! blocks.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
33 %! a = ones (3); a(:,:) = []; assert (size (a), [0, 3]); |
8119
acfd80c08d60
make null assignment more Matlab-compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
34 %!test |
21580
ecce63c99c3f
maint: Add semicolons to terminate code in %! blocks.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
35 %! a = ones (3); a(1:3,:) = []; assert (size (a), [0, 3]); |
8119
acfd80c08d60
make null assignment more Matlab-compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
36 %!test |
21580
ecce63c99c3f
maint: Add semicolons to terminate code in %! blocks.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
37 %! a = ones (3); a(:,1:3) = []; assert (size (a), [3, 0]); |
8119
acfd80c08d60
make null assignment more Matlab-compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
38 %!test |
acfd80c08d60
make null assignment more Matlab-compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
39 %! a = ones (3); fail ("a(1:2,1:2) = []", ".*"); |
acfd80c08d60
make null assignment more Matlab-compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
40 %!test |
acfd80c08d60
make null assignment more Matlab-compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
41 %! a = ones (3); fail ("a(1:3,1:3) = []", ".*"); |
acfd80c08d60
make null assignment more Matlab-compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
42 |
14131
c3309e1ec50d
test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
43 ## null strings should delete. [,] and [;] should delete. |
8156
2bc8ec18b2ea
add more tests for null assignment
Jaroslav Hajek <highegg@gmail.com>
parents:
8119
diff
changeset
|
44 %!test |
21580
ecce63c99c3f
maint: Add semicolons to terminate code in %! blocks.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
45 %! a = ones (3); a(1:2,:) = [,]; assert (size (a), [1,3]); |
8156
2bc8ec18b2ea
add more tests for null assignment
Jaroslav Hajek <highegg@gmail.com>
parents:
8119
diff
changeset
|
46 %!test |
21580
ecce63c99c3f
maint: Add semicolons to terminate code in %! blocks.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
47 %! a = ones (3); a(1:2,:) = [;]; assert (size (a), [1,3]); |
8156
2bc8ec18b2ea
add more tests for null assignment
Jaroslav Hajek <highegg@gmail.com>
parents:
8119
diff
changeset
|
48 %!test |
21580
ecce63c99c3f
maint: Add semicolons to terminate code in %! blocks.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
49 %! a = ones (3); a(1:2,:) = ''; assert (size (a), [1,3]); |
8156
2bc8ec18b2ea
add more tests for null assignment
Jaroslav Hajek <highegg@gmail.com>
parents:
8119
diff
changeset
|
50 %!test |
21580
ecce63c99c3f
maint: Add semicolons to terminate code in %! blocks.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
51 %! a = ones (3); a(1:2,:) = ""; assert (size (a), [1,3]); |
8156
2bc8ec18b2ea
add more tests for null assignment
Jaroslav Hajek <highegg@gmail.com>
parents:
8119
diff
changeset
|
52 |
14131
c3309e1ec50d
test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
53 ## null matrix stored anywhere should lose its special status |
8156
2bc8ec18b2ea
add more tests for null assignment
Jaroslav Hajek <highegg@gmail.com>
parents:
8119
diff
changeset
|
54 %!test |
21580
ecce63c99c3f
maint: Add semicolons to terminate code in %! blocks.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
55 %! a = ones (3); b = []; fail ("a(:,1:3) = b", "."); |
8156
2bc8ec18b2ea
add more tests for null assignment
Jaroslav Hajek <highegg@gmail.com>
parents:
8119
diff
changeset
|
56 %!test |
21580
ecce63c99c3f
maint: Add semicolons to terminate code in %! blocks.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
57 %! a = ones (3); b{1} = []; fail ("a(:,1:3) = b{1}", "."); |
8156
2bc8ec18b2ea
add more tests for null assignment
Jaroslav Hajek <highegg@gmail.com>
parents:
8119
diff
changeset
|
58 %!test |
21580
ecce63c99c3f
maint: Add semicolons to terminate code in %! blocks.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
59 %! a = ones (3); b.x = []; fail ("a(:,1:3) = b.x", "."); |
8156
2bc8ec18b2ea
add more tests for null assignment
Jaroslav Hajek <highegg@gmail.com>
parents:
8119
diff
changeset
|
60 |
14131
c3309e1ec50d
test: Use Octave coding and spacing conventions for fixed test scripts
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
61 ## filtering a null matrix through a function should not delete |
8156
2bc8ec18b2ea
add more tests for null assignment
Jaroslav Hajek <highegg@gmail.com>
parents:
8119
diff
changeset
|
62 %!test |
21580
ecce63c99c3f
maint: Add semicolons to terminate code in %! blocks.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
63 %! a = ones (3); fail ("a(:,1:3) = double ([])"); |
8156
2bc8ec18b2ea
add more tests for null assignment
Jaroslav Hajek <highegg@gmail.com>
parents:
8119
diff
changeset
|
64 |
22439
455bb5c0e03c
* null-assign.tst: Update subsasgn test (bug #48867)
John W. Eaton <jwe@octave.org>
parents:
22323
diff
changeset
|
65 ## for compatibility with Matlab, subsasgn allows any 0x0 double array |
455bb5c0e03c
* null-assign.tst: Update subsasgn test (bug #48867)
John W. Eaton <jwe@octave.org>
parents:
22323
diff
changeset
|
66 ## but not other empty arrays (bug #48867) |
455bb5c0e03c
* null-assign.tst: Update subsasgn test (bug #48867)
John W. Eaton <jwe@octave.org>
parents:
22323
diff
changeset
|
67 %!test |
455bb5c0e03c
* null-assign.tst: Update subsasgn test (bug #48867)
John W. Eaton <jwe@octave.org>
parents:
22323
diff
changeset
|
68 %! a = ones (3); |
455bb5c0e03c
* null-assign.tst: Update subsasgn test (bug #48867)
John W. Eaton <jwe@octave.org>
parents:
22323
diff
changeset
|
69 %! a = subsasgn (a, substruct ('()', {':',1:2}), []); |
455bb5c0e03c
* null-assign.tst: Update subsasgn test (bug #48867)
John W. Eaton <jwe@octave.org>
parents:
22323
diff
changeset
|
70 %! assert (size (a), [3,1]); |
8156
2bc8ec18b2ea
add more tests for null assignment
Jaroslav Hajek <highegg@gmail.com>
parents:
8119
diff
changeset
|
71 %!test |
22439
455bb5c0e03c
* null-assign.tst: Update subsasgn test (bug #48867)
John W. Eaton <jwe@octave.org>
parents:
22323
diff
changeset
|
72 %! a = ones (3); b = zeros (0, 0); |
455bb5c0e03c
* null-assign.tst: Update subsasgn test (bug #48867)
John W. Eaton <jwe@octave.org>
parents:
22323
diff
changeset
|
73 %! a = subsasgn (a, substruct ('()', {':',1:2}), b); |
455bb5c0e03c
* null-assign.tst: Update subsasgn test (bug #48867)
John W. Eaton <jwe@octave.org>
parents:
22323
diff
changeset
|
74 %! assert (size (a), [3,1]); |
8156
2bc8ec18b2ea
add more tests for null assignment
Jaroslav Hajek <highegg@gmail.com>
parents:
8119
diff
changeset
|
75 %!test |
22439
455bb5c0e03c
* null-assign.tst: Update subsasgn test (bug #48867)
John W. Eaton <jwe@octave.org>
parents:
22323
diff
changeset
|
76 %! a = ones (3); b = zeros (0, 0, 2); |
455bb5c0e03c
* null-assign.tst: Update subsasgn test (bug #48867)
John W. Eaton <jwe@octave.org>
parents:
22323
diff
changeset
|
77 %! fail ("subsasgn (a, substruct ('()', {':',1:2}), b)", "."); |
455bb5c0e03c
* null-assign.tst: Update subsasgn test (bug #48867)
John W. Eaton <jwe@octave.org>
parents:
22323
diff
changeset
|
78 %!test |
455bb5c0e03c
* null-assign.tst: Update subsasgn test (bug #48867)
John W. Eaton <jwe@octave.org>
parents:
22323
diff
changeset
|
79 %! a = ones (3); b = zeros (0, 0, "uint8"); |
455bb5c0e03c
* null-assign.tst: Update subsasgn test (bug #48867)
John W. Eaton <jwe@octave.org>
parents:
22323
diff
changeset
|
80 %! fail ("subsasgn (a, substruct ('()', {':',1:2}), b)", "."); |
8156
2bc8ec18b2ea
add more tests for null assignment
Jaroslav Hajek <highegg@gmail.com>
parents:
8119
diff
changeset
|
81 |
18213
cda4bd2fd0c0
fix null matrix assignment to indexed integer and logical values (bug #35921)
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
82 %!test |
cda4bd2fd0c0
fix null matrix assignment to indexed integer and logical values (bug #35921)
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
83 %! classes = {@int8, @int16, @int32, @int64, ... |
cda4bd2fd0c0
fix null matrix assignment to indexed integer and logical values (bug #35921)
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
84 %! @uint8, @uint16, @uint32, @uint64, ... |
cda4bd2fd0c0
fix null matrix assignment to indexed integer and logical values (bug #35921)
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
85 %! @single, @double, @logical}; |
cda4bd2fd0c0
fix null matrix assignment to indexed integer and logical values (bug #35921)
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
86 %! for i = 1:numel (classes) |
cda4bd2fd0c0
fix null matrix assignment to indexed integer and logical values (bug #35921)
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
87 %! cls = classes{i}; |
cda4bd2fd0c0
fix null matrix assignment to indexed integer and logical values (bug #35921)
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
88 %! x = cls ([1, 2, 3]); |
cda4bd2fd0c0
fix null matrix assignment to indexed integer and logical values (bug #35921)
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
89 %! cls_nm = class (x); |
cda4bd2fd0c0
fix null matrix assignment to indexed integer and logical values (bug #35921)
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
90 %! x(2) = []; |
cda4bd2fd0c0
fix null matrix assignment to indexed integer and logical values (bug #35921)
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
91 %! assert (x, cls ([1, 3])); |
cda4bd2fd0c0
fix null matrix assignment to indexed integer and logical values (bug #35921)
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
92 %! assert (class (x), cls_nm); |
cda4bd2fd0c0
fix null matrix assignment to indexed integer and logical values (bug #35921)
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
93 %! x(2) = []; |
cda4bd2fd0c0
fix null matrix assignment to indexed integer and logical values (bug #35921)
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
94 %! assert (x, cls (1)); |
cda4bd2fd0c0
fix null matrix assignment to indexed integer and logical values (bug #35921)
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
95 %! assert (class (x), cls_nm); |
cda4bd2fd0c0
fix null matrix assignment to indexed integer and logical values (bug #35921)
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
96 %! x(1) = []; |
cda4bd2fd0c0
fix null matrix assignment to indexed integer and logical values (bug #35921)
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
97 %! assert (x, cls (zeros (1, 0))); |
cda4bd2fd0c0
fix null matrix assignment to indexed integer and logical values (bug #35921)
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
98 %! assert (class (x), cls_nm); |
cda4bd2fd0c0
fix null matrix assignment to indexed integer and logical values (bug #35921)
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
99 %! endfor |
cda4bd2fd0c0
fix null matrix assignment to indexed integer and logical values (bug #35921)
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
100 %! for i = 1:numel (classes) |
cda4bd2fd0c0
fix null matrix assignment to indexed integer and logical values (bug #35921)
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
101 %! cls = classes{i}; |
cda4bd2fd0c0
fix null matrix assignment to indexed integer and logical values (bug #35921)
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
102 %! x = cls ([1, 2, 3]); |
cda4bd2fd0c0
fix null matrix assignment to indexed integer and logical values (bug #35921)
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
103 %! cls_nm = class (x); |
cda4bd2fd0c0
fix null matrix assignment to indexed integer and logical values (bug #35921)
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
104 %! x(2) = ''; |
cda4bd2fd0c0
fix null matrix assignment to indexed integer and logical values (bug #35921)
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
105 %! assert (x, cls ([1, 3])); |
cda4bd2fd0c0
fix null matrix assignment to indexed integer and logical values (bug #35921)
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
106 %! assert (class (x), cls_nm); |
cda4bd2fd0c0
fix null matrix assignment to indexed integer and logical values (bug #35921)
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
107 %! x(2) = ''; |
cda4bd2fd0c0
fix null matrix assignment to indexed integer and logical values (bug #35921)
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
108 %! assert (x, cls (1)); |
cda4bd2fd0c0
fix null matrix assignment to indexed integer and logical values (bug #35921)
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
109 %! assert (class (x), cls_nm); |
cda4bd2fd0c0
fix null matrix assignment to indexed integer and logical values (bug #35921)
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
110 %! x(1) = ''; |
cda4bd2fd0c0
fix null matrix assignment to indexed integer and logical values (bug #35921)
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
111 %! assert (x, cls (zeros (1, 0))); |
cda4bd2fd0c0
fix null matrix assignment to indexed integer and logical values (bug #35921)
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
112 %! assert (class (x), cls_nm); |
cda4bd2fd0c0
fix null matrix assignment to indexed integer and logical values (bug #35921)
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
113 %! endfor |
cda4bd2fd0c0
fix null matrix assignment to indexed integer and logical values (bug #35921)
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
114 %! for i = 1:numel (classes) |
cda4bd2fd0c0
fix null matrix assignment to indexed integer and logical values (bug #35921)
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
115 %! cls = classes{i}; |
cda4bd2fd0c0
fix null matrix assignment to indexed integer and logical values (bug #35921)
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
116 %! x = cls ([1, 2, 3]); |
cda4bd2fd0c0
fix null matrix assignment to indexed integer and logical values (bug #35921)
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
117 %! cls_nm = class (x); |
cda4bd2fd0c0
fix null matrix assignment to indexed integer and logical values (bug #35921)
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
118 %! x(2) = ""; |
cda4bd2fd0c0
fix null matrix assignment to indexed integer and logical values (bug #35921)
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
119 %! assert (x, cls ([1, 3])); |
cda4bd2fd0c0
fix null matrix assignment to indexed integer and logical values (bug #35921)
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
120 %! assert (class (x), cls_nm); |
cda4bd2fd0c0
fix null matrix assignment to indexed integer and logical values (bug #35921)
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
121 %! x(2) = ""; |
cda4bd2fd0c0
fix null matrix assignment to indexed integer and logical values (bug #35921)
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
122 %! assert (x, cls (1)); |
cda4bd2fd0c0
fix null matrix assignment to indexed integer and logical values (bug #35921)
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
123 %! assert (class (x), cls_nm); |
cda4bd2fd0c0
fix null matrix assignment to indexed integer and logical values (bug #35921)
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
124 %! x(1) = ""; |
cda4bd2fd0c0
fix null matrix assignment to indexed integer and logical values (bug #35921)
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
125 %! assert (x, cls (zeros (1, 0))); |
cda4bd2fd0c0
fix null matrix assignment to indexed integer and logical values (bug #35921)
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
126 %! assert (class (x), cls_nm); |
cda4bd2fd0c0
fix null matrix assignment to indexed integer and logical values (bug #35921)
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
127 %! endfor |