cantera/ext/matlab_xunit/+xunit/+utils/isTestString.m
Ray Speth bac65b26a1 Added machinery for unit testing of the Matlab toolbox
Unit tests are written using the Matlab xUnit Test Framework
2012-03-13 17:32:10 +00:00

15 lines
589 B
Matlab

function tf = isTestString(str)
%isTestString True if string looks like the name of a test
% tf = isTestString(str) returns true if the string str looks like the name of
% a test. If str is a cell array of strings, then isTestString tests each
% string in the cell array, returning the results in a logical array with the
% same size as str.
% Steven L. Eddins
% Copyright 2008-2009 The MathWorks, Inc.
test_at_beginning = '^[tT]est';
test_at_end = '[tT]est$';
tf = xunit.utils.containsRegexp(str, test_at_beginning) | ...
xunit.utils.containsRegexp(str, test_at_end);