mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-24 06:03:49 +00:00
Merge "Use triple equals in abuse filter parser tests"
This commit is contained in:
commit
c6ab7b8e1f
30
tests/parserTests/comparisons.t
Normal file
30
tests/parserTests/comparisons.t
Normal file
|
@ -0,0 +1,30 @@
|
|||
(2 = 2) &
|
||||
(2 == 2) &
|
||||
(2 === 2) &
|
||||
('2' = 2) &
|
||||
('2' == 2) &
|
||||
('2' !== 2) &
|
||||
(['1','2'] = ['1','2']) &
|
||||
(['1','2'] == ['1','2']) &
|
||||
(['1','2'] === ['1','2']) &
|
||||
(['1','2'] != ['2','1']) &
|
||||
(['1','2'] = ['1',2]) &
|
||||
(['1','2'] == ['1',2]) &
|
||||
(['1','2'] !== ['1',2]) &
|
||||
(true = 1) &
|
||||
(true == 1) &
|
||||
(true !== 1) &
|
||||
(false != 0) &
|
||||
(false = '') &
|
||||
(false == '') &
|
||||
(false !== '') &
|
||||
(false = []) &
|
||||
(false == []) &
|
||||
(false !== []) &
|
||||
(false = null) &
|
||||
(false == null) &
|
||||
(false !== null) &
|
||||
([] = null) &
|
||||
([] == null) &
|
||||
([] !== null) &
|
||||
([] != '')
|
|
@ -1 +1 @@
|
|||
lcase("FÁmí") = "fámí"
|
||||
lcase("FÁmí") === "fámí"
|
||||
|
|
|
@ -19,4 +19,3 @@
|
|||
([] == false) &
|
||||
([] == null) &
|
||||
!(['1'] == '1')
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
(1 + 2 * 3 = 7) & (2 ** 2 * 2 = 8) & (1 - 1 - 1 = -1)
|
||||
(1 + 2 * 3 === 7) & (2 ** 2 * 2 === 8) & (1 - 1 - 1 === -1)
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
rcount("a,b,c,d") = 4 &
|
||||
rcount(".", "abcd") = 4
|
||||
rcount("a,b,c,d") === 4 &
|
||||
rcount(".", "abcd") === 4
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
rmdoubles("foobarééqq") = "fobaréq"
|
||||
rmdoubles("foobarééqq") === "fobaréq"
|
||||
|
|
|
@ -1 +1 @@
|
|||
rmspecials("foo;bar!") = "foobar"
|
||||
rmspecials("foo;bar!") === "foobar"
|
||||
|
|
|
@ -1 +1 @@
|
|||
sanitize('یک') = 'یک'
|
||||
sanitize('یک') === 'یک'
|
||||
|
|
|
@ -1 +1 @@
|
|||
ucase("FÁmí") = "FÁMÍ"
|
||||
ucase("FÁmí") === "FÁMÍ"
|
||||
|
|
|
@ -16,6 +16,6 @@ removed_lines_test := ['<ref name="bah">test</ref><ref name="wah">test2</ref>'];
|
|||
/*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))
|
||||
& !(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)))
|
||||
|
|
Loading…
Reference in a new issue