Mercurial > repos > public > sbplib
comparison +blockmatrix/isDivisionTest.m @ 203:764438b52541 feature/grids
blockmatrix: Added functions to test for block matrcies and divisions.
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Wed, 15 Jun 2016 14:29:56 +0200 |
parents | |
children | a5f1b0267dba |
comparison
equal
deleted
inserted
replaced
202:e2fefb6f0746 | 203:764438b52541 |
---|---|
1 function tests = isDivisionTest() | |
2 tests = functiontests(localfunctions); | |
3 end | |
4 | |
5 function testIsDivision(testCase) | |
6 cases = { | |
7 {{[2 2 2],[1 2]} ,true}, | |
8 {{[1 2],[1 0]} ,false}, | |
9 {{[0 2],[1 1]} ,false}, | |
10 {{[1 2],[]} ,false}, | |
11 {{[1 2],[1]} ,true}, | |
12 {{[1 2],[1], [1 2 3]} ,false}, | |
13 {{[1 2 3]} ,false}, | |
14 {[1 2] ,false}, | |
15 }; | |
16 | |
17 for i = 1:length(cases) | |
18 in = cases{i}{1}; | |
19 out = blockmatrix.isDivision(in); | |
20 expected = cases{i}{2}; | |
21 testCase.verifyEqual(out, expected, sprintf('Should return %d for %s', expected, toString(in))); | |
22 end | |
23 end |