comparison +blockmatrix/isDivisionTest.m @ 832:5573913a0949 feature/burgers1d

Merged with default, and updated +scheme/Burgers1D accordingly
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Tue, 11 Sep 2018 15:58:35 +0200
parents a5f1b0267dba
children
comparison
equal deleted inserted replaced
831:d0934d1143b7 832:5573913a0949
1 function tests = isDivisionTest()
2 tests = functiontests(localfunctions);
3 end
4
5 function testIsDivision(testCase)
6 cases = {
7 {[1 2] ,false}, % Must be a cell array
8 {{[1 2 3]} ,false}, % Must have two vectors
9 {{[],[]}, true} % No blocks is a valid blockmatrix
10 {{[1 2],[]} ,true},
11 {{[],[1 2]} ,true},
12 {{[2 2 2],[1 2]} ,true},
13 {{[1 2],[1 0]} ,true},
14 {{[0 2],[1 1]} ,true},
15 {{[1 2],[1]} ,true},
16 {{[1 2],[1], [1 2 3]} ,false},
17 };
18
19 for i = 1:length(cases)
20 in = cases{i}{1};
21 out = blockmatrix.isDivision(in);
22 expected = cases{i}{2};
23 testCase.verifyEqual(out, expected, sprintf('Should return %d for %s', expected, toString(in)));
24 end
25 end