Mercurial > repos > public > sbplib
annotate CellTest.m @ 474:c91464ef1dd9 feature/sublassable_cellarray
Implement tests for horzcat and vertcat. Fix bugs found
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Wed, 02 Aug 2017 09:38:12 +0200 |
parents | c78249d8e915 |
children | e0e81e7df671 |
rev | line source |
---|---|
471 | 1 function tests = CellTest() |
2 tests = functiontests(localfunctions); | |
3 end | |
4 | |
5 function testSubAssignment(testCase) | |
6 testCase.verifyFail(); | |
7 end | |
8 | |
9 function testIndexreference(testCase) | |
10 testCase.verifyFail(); | |
11 end | |
12 | |
13 function testConcat(testCase) | |
474
c91464ef1dd9
Implement tests for horzcat and vertcat. Fix bugs found
Jonatan Werpers <jonatan@werpers.com>
parents:
471
diff
changeset
|
14 cases = { |
c91464ef1dd9
Implement tests for horzcat and vertcat. Fix bugs found
Jonatan Werpers <jonatan@werpers.com>
parents:
471
diff
changeset
|
15 {{},{}}, |
c91464ef1dd9
Implement tests for horzcat and vertcat. Fix bugs found
Jonatan Werpers <jonatan@werpers.com>
parents:
471
diff
changeset
|
16 {{1},{}}, |
c91464ef1dd9
Implement tests for horzcat and vertcat. Fix bugs found
Jonatan Werpers <jonatan@werpers.com>
parents:
471
diff
changeset
|
17 {{},{1}}, |
c91464ef1dd9
Implement tests for horzcat and vertcat. Fix bugs found
Jonatan Werpers <jonatan@werpers.com>
parents:
471
diff
changeset
|
18 {{1},{2}}, |
c91464ef1dd9
Implement tests for horzcat and vertcat. Fix bugs found
Jonatan Werpers <jonatan@werpers.com>
parents:
471
diff
changeset
|
19 {{1, 2},{3, 4}}, |
c91464ef1dd9
Implement tests for horzcat and vertcat. Fix bugs found
Jonatan Werpers <jonatan@werpers.com>
parents:
471
diff
changeset
|
20 {{1; 2},{3; 4}}, |
c91464ef1dd9
Implement tests for horzcat and vertcat. Fix bugs found
Jonatan Werpers <jonatan@werpers.com>
parents:
471
diff
changeset
|
21 }; |
c91464ef1dd9
Implement tests for horzcat and vertcat. Fix bugs found
Jonatan Werpers <jonatan@werpers.com>
parents:
471
diff
changeset
|
22 |
c91464ef1dd9
Implement tests for horzcat and vertcat. Fix bugs found
Jonatan Werpers <jonatan@werpers.com>
parents:
471
diff
changeset
|
23 horzCat = { |
c91464ef1dd9
Implement tests for horzcat and vertcat. Fix bugs found
Jonatan Werpers <jonatan@werpers.com>
parents:
471
diff
changeset
|
24 {}, |
c91464ef1dd9
Implement tests for horzcat and vertcat. Fix bugs found
Jonatan Werpers <jonatan@werpers.com>
parents:
471
diff
changeset
|
25 {1}, |
c91464ef1dd9
Implement tests for horzcat and vertcat. Fix bugs found
Jonatan Werpers <jonatan@werpers.com>
parents:
471
diff
changeset
|
26 {1}, |
c91464ef1dd9
Implement tests for horzcat and vertcat. Fix bugs found
Jonatan Werpers <jonatan@werpers.com>
parents:
471
diff
changeset
|
27 {1,2}, |
c91464ef1dd9
Implement tests for horzcat and vertcat. Fix bugs found
Jonatan Werpers <jonatan@werpers.com>
parents:
471
diff
changeset
|
28 {1, 2, 3, 4}, |
c91464ef1dd9
Implement tests for horzcat and vertcat. Fix bugs found
Jonatan Werpers <jonatan@werpers.com>
parents:
471
diff
changeset
|
29 {1, 3; 2, 4}, |
c91464ef1dd9
Implement tests for horzcat and vertcat. Fix bugs found
Jonatan Werpers <jonatan@werpers.com>
parents:
471
diff
changeset
|
30 }; |
c91464ef1dd9
Implement tests for horzcat and vertcat. Fix bugs found
Jonatan Werpers <jonatan@werpers.com>
parents:
471
diff
changeset
|
31 |
c91464ef1dd9
Implement tests for horzcat and vertcat. Fix bugs found
Jonatan Werpers <jonatan@werpers.com>
parents:
471
diff
changeset
|
32 vertCat = { |
c91464ef1dd9
Implement tests for horzcat and vertcat. Fix bugs found
Jonatan Werpers <jonatan@werpers.com>
parents:
471
diff
changeset
|
33 {}, |
c91464ef1dd9
Implement tests for horzcat and vertcat. Fix bugs found
Jonatan Werpers <jonatan@werpers.com>
parents:
471
diff
changeset
|
34 {1}, |
c91464ef1dd9
Implement tests for horzcat and vertcat. Fix bugs found
Jonatan Werpers <jonatan@werpers.com>
parents:
471
diff
changeset
|
35 {1}, |
c91464ef1dd9
Implement tests for horzcat and vertcat. Fix bugs found
Jonatan Werpers <jonatan@werpers.com>
parents:
471
diff
changeset
|
36 {1; 2}, |
c91464ef1dd9
Implement tests for horzcat and vertcat. Fix bugs found
Jonatan Werpers <jonatan@werpers.com>
parents:
471
diff
changeset
|
37 {1, 2; 3, 4}, |
c91464ef1dd9
Implement tests for horzcat and vertcat. Fix bugs found
Jonatan Werpers <jonatan@werpers.com>
parents:
471
diff
changeset
|
38 {1; 2; 3; 4}, |
c91464ef1dd9
Implement tests for horzcat and vertcat. Fix bugs found
Jonatan Werpers <jonatan@werpers.com>
parents:
471
diff
changeset
|
39 }; |
c91464ef1dd9
Implement tests for horzcat and vertcat. Fix bugs found
Jonatan Werpers <jonatan@werpers.com>
parents:
471
diff
changeset
|
40 |
c91464ef1dd9
Implement tests for horzcat and vertcat. Fix bugs found
Jonatan Werpers <jonatan@werpers.com>
parents:
471
diff
changeset
|
41 for i = 1:length(cases) |
c91464ef1dd9
Implement tests for horzcat and vertcat. Fix bugs found
Jonatan Werpers <jonatan@werpers.com>
parents:
471
diff
changeset
|
42 A = Cell(cases{i}{1}); |
c91464ef1dd9
Implement tests for horzcat and vertcat. Fix bugs found
Jonatan Werpers <jonatan@werpers.com>
parents:
471
diff
changeset
|
43 B = Cell(cases{i}{2}); |
c91464ef1dd9
Implement tests for horzcat and vertcat. Fix bugs found
Jonatan Werpers <jonatan@werpers.com>
parents:
471
diff
changeset
|
44 |
c91464ef1dd9
Implement tests for horzcat and vertcat. Fix bugs found
Jonatan Werpers <jonatan@werpers.com>
parents:
471
diff
changeset
|
45 C_horz = [A, B]; |
c91464ef1dd9
Implement tests for horzcat and vertcat. Fix bugs found
Jonatan Werpers <jonatan@werpers.com>
parents:
471
diff
changeset
|
46 C_vert = [A; B]; |
c91464ef1dd9
Implement tests for horzcat and vertcat. Fix bugs found
Jonatan Werpers <jonatan@werpers.com>
parents:
471
diff
changeset
|
47 |
c91464ef1dd9
Implement tests for horzcat and vertcat. Fix bugs found
Jonatan Werpers <jonatan@werpers.com>
parents:
471
diff
changeset
|
48 testCase.verifyEqual(C_horz.data, horzCat{i}); |
c91464ef1dd9
Implement tests for horzcat and vertcat. Fix bugs found
Jonatan Werpers <jonatan@werpers.com>
parents:
471
diff
changeset
|
49 testCase.verifyEqual(C_vert.data, vertCat{i}); |
c91464ef1dd9
Implement tests for horzcat and vertcat. Fix bugs found
Jonatan Werpers <jonatan@werpers.com>
parents:
471
diff
changeset
|
50 |
c91464ef1dd9
Implement tests for horzcat and vertcat. Fix bugs found
Jonatan Werpers <jonatan@werpers.com>
parents:
471
diff
changeset
|
51 end |
471 | 52 end |