Skip to content

Commit

Permalink
Add 2 case and modified a wrong test answer
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiahuimin committed May 6, 2011
1 parent 903fb41 commit fb2e91a
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions test_strCount.m
Expand Up @@ -2,18 +2,23 @@
%test_strCount runs several tests and returns number of tests that fails.
%Author: Ritu Pradhan
%Date : 03/01/2011

%Modified by Huimin Jia - Added 2 case and modified the wrong test result.

e = 0;
e+= runtest("catcowcat","cat",2);
e+= runtest("catcowcat","cow",1);
e+= runtest("catcowcat","dog",0);
e+= runtest("cacattcowcat","cat",2);
e+= runtest("xyx","x",3);
e+= runtest("xyx","x",2); % modified answer by Huimin Jia
e+= runtest("iiijj","jj",1);
e+= runtest("iiijj","j",2);
e+= runtest("ababababa","aba",4);
e+= runtest("ababababa"," ",0);
e+= runtest("ababababa","b",4);
e+= runtest("","",0);
e+= runtest("iiiii","ii",4); % added by Huimin Jia
e+= runtest("","abc",0); %added by Huimin Jia

end

Expand All @@ -27,6 +32,6 @@
else
e = 1;
fprintf('ERROR:strCount(%s,%s)->%d<> %d\n',str,sub,result,answer);
end
end;

end
end

0 comments on commit fb2e91a

Please sign in to comment.