Mercurial > repos > public > sbplib
comparison +blockmatrix/isDivisionTest.m @ 886:8894e9c49e40 feature/timesteppers
Merge with default for latest changes
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Thu, 15 Nov 2018 16:36:21 -0800 |
parents | a5f1b0267dba |
children |
comparison
equal
deleted
inserted
replaced
816:b5e5b195da1e | 886:8894e9c49e40 |
---|---|
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 |