Mercurial > repos > public > sbplib
view +blockmatrix/toMatrixTest.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 | 50a323da7c7f |
children | a5f1b0267dba |
line wrap: on
line source
function tests = toMatrixTest() tests = functiontests(localfunctions); end function testError(testCase) testCase.verifyError(@()blockmatrix.toMatrix([]), 'blockmatrix:toMatrix:NotABlockmatrix') end function testToMatrix(testCase) cases = { { {}, [], }, { {1, 2; 3, 4}, [1,2; 3,4], } { { [2 2; 2 1], [1; 2]; [2 2], [1] }, [2 2 1; 2 1 2; 2 2 1], }, { { [2 2; 2 1], []; [2 2], [1] }, [2 2 0; 2 1 0; 2 2 1], }, { { [2 2; 2 1], []; [2 2], [] }, [2 2; 2 1; 2 2], }, { { [2 2; 2 1], [1; 2]; [], [] }, [2 2 1; 2 1 2], }, }; for i = 1:length(cases) in = cases{i}{1}; out = full(blockmatrix.toMatrix(in)); expected = cases{i}{2}; testCase.verifyEqual(out, expected); end end