comparison +grid/evalOnTest.m @ 623:190941ec12d8 feature/grids

Print cleaning of evalOn and evalOnTest
author Jonatan Werpers <jonatan@werpers.com>
date Fri, 20 Oct 2017 18:55:02 +0200
parents 4c3f55a628c8
children
comparison
equal deleted inserted replaced
622:0813d700a816 623:190941ec12d8
29 % the number of dimensions of the grid. 29 % the number of dimensions of the grid.
30 function testNumberOfInputs(testCase) 30 function testNumberOfInputs(testCase)
31 cases = { 31 cases = {
32 {getTestGrid('1d'), @(x,y)x-y}, 32 {getTestGrid('1d'), @(x,y)x-y},
33 {getTestGrid('2d'), @(x)x }, 33 {getTestGrid('2d'), @(x)x },
34 } 34 };
35 35
36 for i = 1:length(cases) 36 for i = 1:length(cases)
37 g = cases{i}{1}; 37 g = cases{i}{1};
38 f = cases{i}{2}; 38 f = cases{i}{2};
39 testCase.verifyError(@()grid.evalOn(g, f),'grid:evalOn:WrongNumberOfInputs',sprintf('in(%d) = %s',i,toString(f))); 39 testCase.verifyError(@()grid.evalOn(g, f),'grid:evalOn:WrongNumberOfInputs',sprintf('in(%d) = %s',i,toString(f)));
109 testCase.verifyEqual(gf, out); 109 testCase.verifyEqual(gf, out);
110 end 110 end
111 111
112 112
113 function testInputErrorVectorValued(testCase) 113 function testInputErrorVectorValued(testCase)
114 in = { 114 in = {
115 [1,2,3], 115 [1,2,3],
116 @(x,y)[x,-y]; 116 @(x,y)[x,-y],
117 }; 117 };
118 118
119 g = getTestGrid('2d'); 119 g = getTestGrid('2d');
120 120
121 for i = 1:length(in) 121 for i = 1:length(in)