mediawiki-extensions-AbuseF.../tests/parserTests/count.t
Daimona Eaytoy 4f3b020f5d Improve code coverage for AbuseFilterParser
Add some tests and improve others to raise coverage percentage. This
should lead to almost 100% for the AbuseFilterParser class. Aside from
this, a couple of changes:
* Remove an unused function
* Let equals_to_any return a genuine result with empty strings
* Remove an if which will never be true in skipOverBraces, since the
function is called after checking the same conditions.

Bug: T201193
Change-Id: I7020b2ed996236c38c5784d161ad98ec44163406
2018-08-20 14:38:40 +02:00

9 lines
218 B
Perl

count("a,b,c,d") === 4 &
count(",", "a,b,c,d") === 3 &
count("", "abcd") === 0 &
count("a", "abab") === 2 &
count("ab", "abab") === 2 &
count("aa", "aaaaa") === 2 &
count( [ "a", "b", "c" ] ) === 3 &
count( [] ) === 0