Code covered by the BSD License  

Highlights from
MATLAB xUnit Test Framework

image thumbnail
from MATLAB xUnit Test Framework by Steve Eddins
MATLAB xUnit is a unit test framework for MATLAB code.

PassingExceptionTest
classdef PassingExceptionTest < TestCase
   methods
      function self = PassingExceptionTest(methodName)
         self = self@TestCase(methodName);
      end
      
      function testThrowsException(self)
         f = @() error('a:b:c', 'error message');
         assertExceptionThrown(f, 'a:b:c');
      end
   end
end

Contact us at files@mathworks.com