mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-23 13:46:48 +00:00
Use triple equals in abuse filter parser tests
The only exception is mwexamples-comparisons.t which intentionally includes examples with = and == to test the "weak" version of the comparison operator. Bug: T262063 Change-Id: I6f92aadc69489da481a606bfda89617b8efbb261
This commit is contained in:
parent
04d735117f
commit
d07717dd0d
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