Code covered by the BSD License  

Highlights from
MATLAB xUnit Test Framework

image thumbnail

MATLAB xUnit Test Framework


Steve Eddins (view profile)


31 Jan 2009 (Updated )

MATLAB xUnit is a unit test framework for MATLAB code.

Editor's Notes:

This file was selected as MATLAB Central Pick of the Week

function test_suite = test_arrayToString
%test_arrayToString Unit test for arrayToString.

%   Steven L. Eddins
%   Copyright 2009 The MathWorks, Inc.


function test_smallInput
A = [1 2 3];
assertEqual(strtrim(xunit.utils.arrayToString(A)), '1     2     3');

function test_largeInput
A = zeros(1000, 1000);
assertEqual(xunit.utils.arrayToString(A), '[1000x1000 double]');

function test_emptyInput
assertEqual(xunit.utils.arrayToString(zeros(1,0,2)), '[1x0x2 double]');

Contact us