diff options
author | Yaco <franco@reevo.org> | 2020-06-04 11:01:00 -0300 |
---|---|---|
committer | Yaco <franco@reevo.org> | 2020-06-04 11:01:00 -0300 |
commit | fc7369835258467bf97eb64f184b93691f9a9fd5 (patch) | |
tree | daabd60089d2dd76d9f5fb416b005fbe159c799d /www/wiki/extensions/AbuseFilter/tests/parserTests/wptest2.t |
first commit
Diffstat (limited to 'www/wiki/extensions/AbuseFilter/tests/parserTests/wptest2.t')
-rw-r--r-- | www/wiki/extensions/AbuseFilter/tests/parserTests/wptest2.t | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/www/wiki/extensions/AbuseFilter/tests/parserTests/wptest2.t b/www/wiki/extensions/AbuseFilter/tests/parserTests/wptest2.t new file mode 100644 index 00000000..0e137503 --- /dev/null +++ b/www/wiki/extensions/AbuseFilter/tests/parserTests/wptest2.t @@ -0,0 +1,21 @@ +/* Filter 61 from English Wikipedia (new user removing references) */ +user_groups_test := ["*"]; +new_size_test := 100; +article_namespace_test := 0; +edit_delta_test := -22; +added_lines_test := ['<ref name="bah">test</ref> test2!']; +removed_lines_test := ['<ref name="bah">test</ref><ref name="wah">test2</ref>']; + +!("autoconfirmed" in user_groups_test) +/* this edit_delta ignores large blankings that are treated by another filter */ +& edit_delta_test >= -1000 +& article_namespace_test == 0 +/* No added lines usually mean a blanking which is dealt with by other filter */ +& length(added_lines_test) != 0 +& !("#redirect" in lcase(added_lines_test)) +/*Counts of more reference tags are removed than added */ +& (rcount("(<ref>|<ref\sname|</ref>)",removed_lines_test) > rcount("(<ref>|<ref\sname|</ref>)",added_lines_test)) +/*Excludes changing to the named reference format and removing closing tags attached to formerly named refs. Unequality is to account for closing the first named tag */ +& !(rcount("<ref>",removed_lines_test) = rcount("<ref\sname",added_lines_test) | rcount("</ref>",removed_lines_test) <= rcount("<ref\sname",added_lines_test)) +/*Excludes removal of references to Wikipedia itself */ +& !(count("http://en.wikipedia.org",string(removed_lines_test)) > count("http://en.wikipedia.org",string(added_lines_test))) |