Home > functions > internal > unit-test > dsUnitTest_strrep.m

dsUnitTest_strrep

PURPOSE ^

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 classdef dsUnitTest_strrep < matlab.unittest.TestCase
0002   
0003   methods (Test,  TestTags = {'utility'})
0004     function testDocExamples(testCase)
0005       testCase.verifyTrue(strcmp('(pop1_v)*(-av)', dsStrrep('(v)*(-av)','v','pop1_v') ))
0006       testCase.verifyTrue(strcmp('pop1_v-pop1_v^2+vav', dsStrrep('v-v^2+vav','v','pop1_v') ))
0007       testCase.verifyTrue(strcmp('pop1_v-pop1_v-pop1_v', dsStrrep('v-v-v','v','pop1_v') ))
0008       testCase.verifyTrue(strcmp('pop1_v-pop1_v-pop1_v^2', dsStrrep('v-v-v^2','v','pop1_v') ))
0009       testCase.verifyTrue(strcmp('(pop1_v-pop1_v-pop1_v^2)', dsStrrep('(v-v-v^2)','v','pop1_v') ))
0010       testCase.verifyTrue(strcmp('E-pop1_V(n-1)+1', dsStrrep('E-pop1_V+1','pop1_V','pop1_V(n-1)') ))
0011       testCase.verifyTrue(strcmp('v=1; u(n,test)=u(n,test)+d', dsStrrep('v=1; u=u+d','u','u(n,test)') ))
0012     end
0013     
0014     function testSubString(testCase)
0015       testCase.verifyTrue(strcmp('new.old', dsStrrep('old.old','old','new') ))
0016       testCase.verifyTrue(strcmp('new.old.old', dsStrrep('old.old.old','old','new') ))
0017     end
0018   end
0019   
0020 end

Generated on Tue 12-Dec-2017 11:32:10 by m2html © 2005