Mercurial > repos > public > sbplib
annotate CellTest.m @ 475:e0e81e7df671 feature/sublassable_cellarray
Add test stubs for size and length
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Wed, 02 Aug 2017 10:03:59 +0200 |
parents | c91464ef1dd9 |
children | 949ffe238f61 |
rev | line source |
---|---|
471 | 1 function tests = CellTest() |
2 tests = functiontests(localfunctions); | |
3 end | |
4 | |
475
e0e81e7df671
Add test stubs for size and length
Jonatan Werpers <jonatan@werpers.com>
parents:
474
diff
changeset
|
5 function testSize(testCase) |
e0e81e7df671
Add test stubs for size and length
Jonatan Werpers <jonatan@werpers.com>
parents:
474
diff
changeset
|
6 testCase.verifyFail(); |
e0e81e7df671
Add test stubs for size and length
Jonatan Werpers <jonatan@werpers.com>
parents:
474
diff
changeset
|
7 end |
e0e81e7df671
Add test stubs for size and length
Jonatan Werpers <jonatan@werpers.com>
parents:
474
diff
changeset
|
8 |
e0e81e7df671
Add test stubs for size and length
Jonatan Werpers <jonatan@werpers.com>
parents:
474
diff
changeset
|
9 function testLength(testCase) |
e0e81e7df671
Add test stubs for size and length
Jonatan Werpers <jonatan@werpers.com>
parents:
474
diff
changeset
|
10 testCase.verifyFail(); |
e0e81e7df671
Add test stubs for size and length
Jonatan Werpers <jonatan@werpers.com>
parents:
474
diff
changeset
|
11 end |
e0e81e7df671
Add test stubs for size and length
Jonatan Werpers <jonatan@werpers.com>
parents:
474
diff
changeset
|
12 |
471 | 13 function testSubAssignment(testCase) |
14 testCase.verifyFail(); | |
15 end | |
16 | |
17 function testIndexreference(testCase) | |
18 testCase.verifyFail(); | |
19 end | |
20 | |
21 function testConcat(testCase) | |
474
c91464ef1dd9
Implement tests for horzcat and vertcat. Fix bugs found
Jonatan Werpers <jonatan@werpers.com>
parents:
471
diff
changeset
|
22 cases = { |
c91464ef1dd9
Implement tests for horzcat and vertcat. Fix bugs found
Jonatan Werpers <jonatan@werpers.com>
parents:
471
diff
changeset
|
23 {{},{}}, |
c91464ef1dd9
Implement tests for horzcat and vertcat. Fix bugs found
Jonatan Werpers <jonatan@werpers.com>
parents:
471
diff
changeset
|
24 {{1},{}}, |
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},{2}}, |
c91464ef1dd9
Implement tests for horzcat and vertcat. Fix bugs found
Jonatan Werpers <jonatan@werpers.com>
parents:
471
diff
changeset
|
27 {{1, 2},{3, 4}}, |
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 }; |
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 horzCat = { |
c91464ef1dd9
Implement tests for horzcat and vertcat. Fix bugs found
Jonatan Werpers <jonatan@werpers.com>
parents:
471
diff
changeset
|
32 {}, |
c91464ef1dd9
Implement tests for horzcat and vertcat. Fix bugs found
Jonatan Werpers <jonatan@werpers.com>
parents:
471
diff
changeset
|
33 {1}, |
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,2}, |
c91464ef1dd9
Implement tests for horzcat and vertcat. Fix bugs found
Jonatan Werpers <jonatan@werpers.com>
parents:
471
diff
changeset
|
36 {1, 2, 3, 4}, |
c91464ef1dd9
Implement tests for horzcat and vertcat. Fix bugs found
Jonatan Werpers <jonatan@werpers.com>
parents:
471
diff
changeset
|
37 {1, 3; 2, 4}, |
c91464ef1dd9
Implement tests for horzcat and vertcat. Fix bugs found
Jonatan Werpers <jonatan@werpers.com>
parents:
471
diff
changeset
|
38 }; |
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 vertCat = { |
c91464ef1dd9
Implement tests for horzcat and vertcat. Fix bugs found
Jonatan Werpers <jonatan@werpers.com>
parents:
471
diff
changeset
|
41 {}, |
c91464ef1dd9
Implement tests for horzcat and vertcat. Fix bugs found
Jonatan Werpers <jonatan@werpers.com>
parents:
471
diff
changeset
|
42 {1}, |
c91464ef1dd9
Implement tests for horzcat and vertcat. Fix bugs found
Jonatan Werpers <jonatan@werpers.com>
parents:
471
diff
changeset
|
43 {1}, |
c91464ef1dd9
Implement tests for horzcat and vertcat. Fix bugs found
Jonatan Werpers <jonatan@werpers.com>
parents:
471
diff
changeset
|
44 {1; 2}, |
c91464ef1dd9
Implement tests for horzcat and vertcat. Fix bugs found
Jonatan Werpers <jonatan@werpers.com>
parents:
471
diff
changeset
|
45 {1, 2; 3, 4}, |
c91464ef1dd9
Implement tests for horzcat and vertcat. Fix bugs found
Jonatan Werpers <jonatan@werpers.com>
parents:
471
diff
changeset
|
46 {1; 2; 3; 4}, |
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 |
c91464ef1dd9
Implement tests for horzcat and vertcat. Fix bugs found
Jonatan Werpers <jonatan@werpers.com>
parents:
471
diff
changeset
|
49 for i = 1:length(cases) |
c91464ef1dd9
Implement tests for horzcat and vertcat. Fix bugs found
Jonatan Werpers <jonatan@werpers.com>
parents:
471
diff
changeset
|
50 A = Cell(cases{i}{1}); |
c91464ef1dd9
Implement tests for horzcat and vertcat. Fix bugs found
Jonatan Werpers <jonatan@werpers.com>
parents:
471
diff
changeset
|
51 B = Cell(cases{i}{2}); |
c91464ef1dd9
Implement tests for horzcat and vertcat. Fix bugs found
Jonatan Werpers <jonatan@werpers.com>
parents:
471
diff
changeset
|
52 |
c91464ef1dd9
Implement tests for horzcat and vertcat. Fix bugs found
Jonatan Werpers <jonatan@werpers.com>
parents:
471
diff
changeset
|
53 C_horz = [A, B]; |
c91464ef1dd9
Implement tests for horzcat and vertcat. Fix bugs found
Jonatan Werpers <jonatan@werpers.com>
parents:
471
diff
changeset
|
54 C_vert = [A; B]; |
c91464ef1dd9
Implement tests for horzcat and vertcat. Fix bugs found
Jonatan Werpers <jonatan@werpers.com>
parents:
471
diff
changeset
|
55 |
c91464ef1dd9
Implement tests for horzcat and vertcat. Fix bugs found
Jonatan Werpers <jonatan@werpers.com>
parents:
471
diff
changeset
|
56 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
|
57 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
|
58 |
c91464ef1dd9
Implement tests for horzcat and vertcat. Fix bugs found
Jonatan Werpers <jonatan@werpers.com>
parents:
471
diff
changeset
|
59 end |
471 | 60 end |