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:
Huji Lee 2020-09-04 13:07:53 -04:00
parent 04d735117f
commit d07717dd0d
10 changed files with 39 additions and 10 deletions

View 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) &
([] != '')

View file

@ -1 +1 @@
lcase("FÁmí") = "fámí"
lcase("FÁmí") === "fámí"

View file

@ -19,4 +19,3 @@
([] == false) &
([] == null) &
!(['1'] == '1')

View file

@ -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)

View file

@ -1,3 +1,3 @@
rcount("a,b,c,d") = 4 &
rcount(".", "abcd") = 4
rcount("a,b,c,d") === 4 &
rcount(".", "abcd") === 4

View file

@ -1 +1 @@
rmdoubles("foobarééqq") = "fobaréq"
rmdoubles("foobarééqq") === "fobaréq"

View file

@ -1 +1 @@
rmspecials("foo;bar!") = "foobar"
rmspecials("foo;bar!") === "foobar"

View file

@ -1 +1 @@
sanitize('یک') = 'یک'
sanitize('یک') === 'یک'

View file

@ -1 +1 @@
ucase("FÁmí") = "FÁMÍ"
ucase("FÁmí") === "FÁMÍ"

View file

@ -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)))