Watch this Author's files
If you are putting multiple tests in a single file, don't start any function names with "setup". The following code fails. Remove setup and it works.
function test_suite = testFliplr initTestSuite; end
function testFliplrMatrix in = magic(3); assertEqual(fliplr(in), in(:, [3 2 1])); end
function testFliplrVector assertEqual(fliplr([1 4 10]), [10 4 1]); end
function test3 [a b] = setupdata; assertEqual(a,1); assertEqual(b,2); end
function [a b] = setupdata a = 1; b = 2; end
I think there is a divide by inf in computing the relative tolerance. Using the 'absolute' flag provides the correct result.
Great software! Thanks. I noticed a bug:
function testStuff assertElementsAlmostEqual(0,Inf) assertVectorsAlmostEqual(0,Inf) end
Will not flag a failure.
--N
Contact us at files@mathworks.com