Mercurial > repos > public > sbplib
comparison +blockmatrix/isDivisionTest.m @ 427:a613960a157b feature/quantumTriangles
merged with feature/beams
author | Ylva Rydin <ylva.rydin@telia.com> |
---|---|
date | Thu, 26 Jan 2017 15:59:25 +0100 |
parents | 764438b52541 |
children | a5f1b0267dba |
comparison
equal
deleted
inserted
replaced
426:29944ea7674b | 427:a613960a157b |
---|---|
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 |