view +blockmatrix/isDivisionTest.m @ 572:4a73b2aab91f feature/utux2D

Edit scheme.Utux: Add interface function. Compatible with new grids. Works with Utux_1D_interface.
author Martin Almquist <martin.almquist@it.uu.se>
date Thu, 31 Aug 2017 14:57:34 +0200
parents 764438b52541
children a5f1b0267dba
line wrap: on
line source

function tests = isDivisionTest()
    tests = functiontests(localfunctions);
end

function testIsDivision(testCase)
    cases = {
        {{[2 2 2],[1 2]} ,true},
        {{[1 2],[1 0]} ,false},
        {{[0 2],[1 1]} ,false},
        {{[1 2],[]} ,false},
        {{[1 2],[1]} ,true},
        {{[1 2],[1], [1 2 3]} ,false},
        {{[1 2 3]} ,false},
        {[1 2] ,false},
    };

    for i = 1:length(cases)
        in = cases{i}{1};
        out = blockmatrix.isDivision(in);
        expected = cases{i}{2};
        testCase.verifyEqual(out, expected, sprintf('Should return %d for %s', expected, toString(in)));
    end
end