Viewing File: /home/omtekel/www/wp-content/upgrade/backup/parserTests.tar

strpos.t000066600000000345151334754530006303 0ustar00strpos( "foobarfoo", "foo" ) === 0 &
strpos( "foobarfoo", "" ) === -1 &
strpos( "foobarfoo", "foo", 1 ) === 6 &
strpos( "foobarfoo", "lol" ) === -1 &
/* Offset not contained in the haystack */
strpos( "foo", "o", 123456 ) === -1
ip-in-ranges.t000066600000003420151334754530007237 0ustar00ip_in_ranges( '12.34.56.78', '12.34.56.0/24', '12.34.0.0/16' ) === true &
ip_in_ranges( '12.34.56.78', '65.43.0.0/16', '12.34.56.78/32' ) === true &
ip_in_ranges( '12.34.56.78', '12.0.0.0/8', '13.0.0.0/8' ) === true &
ip_in_ranges( '12.34.56.78', '12.34.56.78', '2001:db8::/16' ) === true &
ip_in_ranges( '12.34.56.78', '12.1.2.255/8', '::' ) === true &
ip_in_ranges( '1.1.1.1', '1.1.1.1/32', '2.2.2.2/32' ) === true &
ip_in_ranges( '1.1.1.1', '1.1.1.1', '1.1.1.1', '1.1.1.1/32' ) === true &
ip_in_ranges( '1.1.1.1', '0.0.0.0/0', '0.0.0.0/1', '0.0.0.0/2', '0.0.0.0/3' ) === true &
ip_in_ranges( '1.1.1.1', '::', '::/0', '::/1' ) === false &
ip_in_ranges( '123.123.123.123', '123.123.123.123', '123.123.123.123' ) === true &
ip_in_ranges( '123.123.123.123', '123.0.0.0-123.122.0.0', '123.124.0.0-124.122.0.0' ) === false &
ip_in_ranges( '123.123.123.123', '125.0.0.0 - 127.0.0.0', '123.0.0.0-124.0.0.0' ) === true &
ip_in_ranges( '123.123.123.123', '123.0.0.0-127.0.0.0', '123.123.0.0 - 124.0.0.0' ) === true &
ip_in_ranges( '123.123.123.123', '127.0.0.0-123.0.0.0', '120.0.0.0-123.0.0.0' ) === false &
ip_in_ranges( '123.123.123.123', '127.0.0.0-123.0.0.0', '123.0.0.0-127.0.0.0' ) === true &
ip_in_ranges( '11.11.11.11', '11.11.11.1', '1.11.11.11', '11.1.11.11', '11.11.1.11' ) === false &
ip_in_ranges( '1.1.1.1', '::-ffff::', '0.0.0.0-255.255.255.255' ) === true &
ip_in_ranges( '2001:db8:85a3::8a2e:0370:7334', '::-ffff::', '0.0.0.0-255.255.255.255' ) === true &
ip_in_ranges( '2001:db8:85a3::8a2e:0370:7334', '2001:db8:85a3::8a2e:370:7334/113', '2001:db8:85a3::8a2e:370:0000-2001:db8:85a3::8a2e:370:8888' ) === true &
ip_in_ranges( '1.1.1.1', '::-ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff', '0.0.0.0' ) === false &
ip_in_ranges( '2001:db8:85a3::8a2e:370:0000', '0.0.0.0-255.255.255.255', '::' ) === false
whitespace1.t000066600000000021151334754530007155 0ustar001 == length("a")
float.t000066600000000135151334754530006053 0ustar00(5 / 2 === 2.5) & (int(5 / 2) === 2) & (5. / 2 === 2.5) & (5 / 2. === 2.5) & (int(.5) === 0)
like.t000066600000000064151334754530005673 0ustar00"f+oo-bér" like "f+oo-b?r" & "quux" matches "qu*x"
str-replace-regexp.t000066600000000303151334754530010454 0ustar00str_replace_regexp( "foobarbaz", "bar", "" ) === 'foobaz' &
str_replace_regexp( "foo1bar1baz", "\d", "" ) === 'foobarbaz' &
str_replace_regexp( "foobarbaz", "(bar)", "$1baz" ) === 'foobarbazbaz'
vars.t000066600000000222151334754530005716 0ustar00/* Variables test */
test_var1 := test_var2 := "aa";
set( 'ResulT', set_var( 'TV3', "bb" ) );

str_replace( test_var1, test_var2, tv3 ) == result;array-statements3.t000066600000000117151334754530010334 0ustar00/* intEval used to return a tree node for this - T236870 */
a := [];
a[] := 2;
mwexamples-comparisons.t000066600000000651151334754530011466 0ustar00/* Examples from [[mw:Extension:AbuseFilter/Rules format#Simple comparisons]] */

!(1 == 2) &
(1 <= 2) &
!(1 >= 2) &
(1 != 2) &
(1 < 2)	&
!(1 > 2) &
(2 = 2) &
('' == false) &
!('' === false) &
(1 == true) &
!(1 === true) &
(['1','2','3'] == ['1','2','3']) &
([1,2,3] === [1,2,3]) &
(['1','2','3'] == [1,2,3]) &
!(['1','2','3'] === [1,2,3]) &
([1,1,''] == [true, true, false]) &
([] == false) &
([] == null) &
!(['1'] == '1')
contains-all.t000066600000000327151334754530007335 0ustar00contains_all("the foo is on the bar", "foo", "is on", "bar") &
!(contains_all(['foo', 'bar', 'hey'], 'foo', 'bar', 'sup')) &
contains_all([1, 2, 3], '1', '2', '3') &
contains_all(
	'base',
	'b',
	'a',
	's',
	'e',
)
lazykeyword.t000066600000000027151334754530007332 0ustar001 === 1 | "a" like "b"
mwexamples-bools.t000066600000000270151334754530010244 0ustar00/* Examples from [[mw:Extension:AbuseFilter/Rules format#Boolean operations]] */

(1 | 1) &
(1 | 0) &
!(0 | 0) &
(1 & 1) &
!(1 & 0) &
!(0 & 0) &
!(1 ^ 1) &
(1 ^ 0) &
!(0 ^ 0) &
!(!1)

expn.t000066600000000126151334754530005720 0ustar00/* In filter language, the exponentiation is left-associative */
(2 ** 3 ** 2) === 64
array-statements2.t000066600000000142151334754530010331 0ustar00/* intEval used to return a tree node for this */
var := [1];
var[0] := str_replace('a','b','c');
substr.t000066600000000104151334754530006264 0ustar00substr( "foobar", 0, 3 ) === "foo" &
substr( "barfoo", 4 ) === "oo"
contains-any.t000066600000000260151334754530007350 0ustar00contains_any("like anyone else", "else", "someone") &
contains_any("street fighter", "fight") &
!(contains_any('My foo is cute', 'bar', 'wtf')) &
contains_any([[1], [2,3]], 1)
concatenation.t000066600000000332151334754530007572 0ustar00'foo' + 'bar' === 'foobar' &
'' + 'foo' + '' === 'foo' &
'foo' + ' ' + 'bar' === 'foo bar' &
'foo' + 234 === 'foo234' &
452 + 'foo' === '452foo' &
'foo' + false === 'foo' &
'foo' + [ 'bar', 'foo' ] === 'foobar\nfoo\n'
eq.t000066600000000073151334754530005354 0ustar00(1 == 1) & (1 != 2) & (1 === 1) & (1 == "1") & (1 !== "1")
equals-to-any.t000066600000001123151334754530007443 0ustar00equals_to_any( "foo", "bar", "foo", "pizza" ) &
equals_to_any( 15, 3, 77, 18, 15 ) &
equals_to_any( "", 3, 77, 18, 15, "duh" ) === false &
equals_to_any( "", 3, 77, 18, 15, "duh", "" ) &
equals_to_any( true, 1, "true" ) === false &
equals_to_any( "1", 1, [ 1 ], true ) === false &
equals_to_any( [ 1, "1" ], 1, "1" ) === false &
equals_to_any( [ 1, 2, 3 ], [ 1, 2, 3 ] ) &
equals_to_any( [ 1, 2, 3 ], [ 3, 2, 1 ] ) === false &
equals_to_any( [ "foo", "bar" ], [ ] ) === false &
equals_to_any( [ "foo", "bar" ], [ "foo", "bar" ] ) &
equals_to_any( [], [] ) &
equals_to_any( [ 0 ], [] ) === false
comparisons.t000066600000001006151334754530007301 0ustar00(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) &
([] != '')
multipleconditionals.t000066600000000443151334754530011212 0ustar00/* For T152281 */
v1 := 0; v2 := 0;
if ( 1 == 1 ) then
(
  v1 := 1; v2 := 1;
)
else
(
  v1 := 2; v2 := 2;
)
end;

if ( 1 == 1 ) then
  ( v1 := 1; )
else
(
  v1 := 2; v2 := 2;
)
end;

if ( 1 == 1 ) then
  ( v1 := 2 === 2 ? 1 : 3; )
else
(
  v1 := 'x' === 'y' ? 2 : 3;
  v2 := v1 ** 2;
)
end;
ifthen.t000066600000000202151334754530006216 0ustar00(if 1 then 2 else 3 end) === 2 &
(if false then 2 else 3 end) === 3 &
(if true then 3 end) === 3 &
(if false then 3 end) === null
specialratio.t000066600000000072151334754530007425 0ustar00specialratio("foó;") === 0.25 &
specialratio("") === 0.0
tern.t000066600000000027151334754530005716 0ustar001 ? 0 ? 3 : 4 : 5 == 4
rmdoubles.t000066600000000051151334754530006737 0ustar00rmdoubles("foobarééqq") === "fobaréq"
array-statements.t000066600000000113151334754530010245 0ustar00/* intEval used to return a tree node for this */
var := [1];
var[0] := 2;
prec.t000066600000000074151334754530005701 0ustar00(1 + 2 * 3 === 7) & (2 ** 2 * 2 === 8) & (1 - 1 - 1 === -1)
ip-in-range.t000066600000002341151334754530007055 0ustar00ip_in_range( '12.34.56.78', '12.34.56.0/24' ) &
ip_in_range( '12.34.56.78', '12.34.0.0/16' ) &
ip_in_range( '12.34.56.78', '12.0.0.0/8' ) &
ip_in_range( '1.1.1.1', '1.1.1.1/32' ) &
ip_in_range( '1.1.1.1', '0.0.0.0/1' ) &
ip_in_range( '1.1.1.1', '1.1.1.0/24' ) === true &
ip_in_range( '55.55.55.55', '55.55.0.0/16' ) === true &
ip_in_range( '123.123.123.123', '123.123.123.123/32' ) === true &
ip_in_range( '123.123.123.123', '123.123.123.123' ) === true &
ip_in_range( '123.123.123.123', '123.0.0.0-124.0.0.0' ) === true &
ip_in_range( '123.123.123.123', '123.0.0.0 - 124.0.0.0' ) === true &
ip_in_range( '123.123.123.123', '123.123.123.0-123.123.123.255' ) === true &
ip_in_range( '123.123.123.123', '125.0.0.0-124.0.0.0' ) === false &
ip_in_range( '11.11.11.11', '11.11.11.1' ) === false &
ip_in_range( '1.1.1.1', '1.1.1.1-255.255.255.255' ) === true &
ip_in_range( '2001:db8:85a3::8a2e:0370:7334', '2001:db8:85a3::8a2e:370:7334/113' ) === true &
ip_in_range( '2001:db8:85a3::8a2e:0370:7334', '2001:db8:85a3::8a2e:370:0000-2001:db8:85a3::8a2e:370:8888' ) === true &
ip_in_range( '1.1.1.1', '2001:db8:85a3::8a2e:370:0000-2001:db8:85a3::8a2e:370:8888' ) === false &
ip_in_range( '2001:db8:85a3::8a2e:370:0000', '0.0.0.0-255.255.255.255' ) === false
lazysum.t000066600000000026151334754530006451 0ustar001 === 1 | 2 + 3 === 5
get-matches.t000066600000001275151334754530007155 0ustar00get_matches('I am a (dog|cat)', 'What did you say?') === [ false, false ] &
get_matches('The (truth|pineapple) is (?:rarely)? pure and (nee*v(ah|er) sh?imple)', 'The truth is rarely pure and never simple, Wilde said') == ['The truth is rarely pure and never simple', 'truth', 'never simple', 'er'] &
get_matches('You say (.*) \(and I say (.*)\)\.', 'You say hello (and I say goodbye).') === [ 'You say hello (and I say goodbye).', 'hello', 'goodbye' ] &
get_matches('I(?: am)? the ((walrus|egg man).*)\!', 'I am the egg man, I am the walrus !') === [ 'I am the egg man, I am the walrus !', 'egg man, I am the walrus ', 'egg man' ] &
get_matches('this (does) not match', 'foo bar') === [ false, false ]bool-assoc.t000066600000000030151334754530007001 0ustar00!(true | false & false)
arith.t000066600000001076151334754530006062 0ustar00+1 + -1 === 0 &
-1 + +2 === 1 &
-0 === 0 &
(1 + 1 === 2) &
(1.5 + 1.5 === 3.0) &
(2.5 + 1 === 3.5) &
(0 + 1 === 1) &
(2.5 + 0 === 2.5) &
(5 - 3 === 2) &
(5 - 3.5 === 1.5) &
(5.5 - 3.5 === 2.0) &
(1 - 0 === 1) &
(2.5 - 0 === 2.5) &
(2 * 3 === 6) &
(2 * 3.5 === 7.0) &
(2.5 * 3.5 === 8.75) &
(2.5 * 0 === 0.0) &
(10 / 2 === 5) &
(10 / 2.5 === 4.0) &
(18 / 36 === 0.5) &
(0 / 36 === 0) &
(12.5 / 2.5 === 5.0) &
(10.5 / 2.5 === 4.2) &
(10 % 7 === 3) &
(10.48762 % 7 === 3) &
(10 % 7.123576 === 3) &
(2 ** 4 === 16) &
(2.5 ** 2 === 6.25) &
(2.5 ** 0 === 1.0) &
(1000 ** 0 === 1)
shortcircuit-or.t000066600000000126151334754530010106 0ustar00/* The division by zero should not be executed and not crash the filter */
true | 1/0
numbers.t000066600000000501151334754530006416 0ustar00/* Things that are NOT numbers; */
0xfoo := 'foobar';
0b10bar := 'bar';

0xfoo === 'foobar' & 0b10bar === 'bar' &

/* Actual numbers */
0x1A === 0x1a & 0x1a === 26 & 0xa === 10 & 0b11111111 === 255 & 0o123 === 83 & 0x123 === 291 & 0xF === 15 &
0o10 === 8 & 0o1 === 1 & 0b101010 === 42 & 0b101010 === 0x2a & 0x2a === 0o52
shortcircuit-and.t000066600000000131151334754530010224 0ustar00/* The division by zero should not be executed and not crash the filter */
!(false & 1/0)containsfunction.t000066600000000107151334754530010331 0ustar00contains_any( "", "a") === false &
contains_any( "a", "", "a") === truebug25373.t000066600000000034151334754530006125 0ustar00(1 == 1) ? (true) : (false)
length.t000066600000000026151334754530006226 0ustar00length("foobar") == 6
cast.t000066600000000606151334754530005703 0ustar00(string(1) === "1") &
(int("1") === 1) &
(float(1) === 1.0) &
bool(1) & !bool(0) &
bool([]) === false &
bool( [false] ) === true &
bool( [1,2,3,4,5,6] ) === true &
float([]) === 0.0 &
float( [false] ) === 1.0 &
float( [1,2,3,4,5,6] ) === 6.0 &
int([]) === 0 &
int( [false] ) === 1 &
int( [1,2,3,4,5,6] ) === 6 &
true + true === 2 &
null - null === 0 &
true * false === 0 &
163 % true === 0
lazyunarys.t000066600000000023151334754530007163 0ustar001 === 1 | -4 !== 4
string.t000066600000000424151334754530006255 0ustar00"a\tb" === "a	b" &
"a\qb" === "a\qb" &
"a\"b" === 'a"b' &
"a\rb" !== "a\r\nb" &
"\x66\x6f\x6f" === "foo" &
"some\xstring" === "some\\xstring" &
"some\vstring" === "some\\vstring" &
/* T238475 */
'\x{}' === '\x' + '{}' &
length('\x{}') === 4 &
'foobar' rlike '[\x{61}-\x{7a}]'
sanitize.t000066600000000046151334754530006575 0ustar00sanitize('&#1740;&#1705;') === 'یک'
mwexamples-arithmetic.t000066600000000243151334754530011257 0ustar00/* Examples from [[mw:Extension:AbuseFilter/Rules format#Arithmetic]] */

1 + 1 === 2 &
2 * 2 === 4 &
12 / 24 === 0.5 &
24 / 12 === 2 &
9 ** 2 === 81 &
6 % 5 === 1rmspecials.t000066600000000113151334754530007104 0ustar00rmspecials("foo;bar!") === "foobar" &
rmspecials("foo; bar!") === "foo bar"array-assignment.t000066600000000375151334754530010240 0ustar00test_array := [ [1, 2], [3, 4], 'useless' ];

test_array[1] := 42;
test_array[ if true then 2 else 0 end] := 'foo';
test_array[] := 17;

test_array[0][0] == 1 & test_array[0][1] == 2 & test_array[1] == 42 & test_array[2] === 'foo' & test_array[3] == 17
array-comparisons.t000066600000000755151334754530010427 0ustar00a := [1, 2, 3];
b := [1, 2, 3];
c := [2, 3, 4];
d := [1, 2, 3, 4];
e := ['1', '2', '3'];
f := [[['1']]];
g := [[[1]]];
h := [[1, 2], 3];
i := [['1', 2], '3'];
j := [1];
k := ['1'];
l := [];
m := 42;
n := [0,1];

a == b & a === b & a != c & b != d & a == e & a !== e & f == g & f !== g & h == i & h !== i & e != i & j != 1 &
k != '1' & l == false & l == null & l !== false & l !== null & false == l & null == l & false !== l & null !== l &
b[5**2/((4+1)*5)] == a[43-m] & a[n[0]] === b[n[m-42]]
ord.t000066600000000133151334754530005530 0ustar001 > 0 &
0 < 1 &
2 >= 2 &
2 <= 2 &
0.1 < 0.2 &
0.001 <= 0.001 &
-0.01 < 0.01 &
0 >= -0.0001
multipleskipbraces.t000066600000000036151334754530010650 0ustar001 === 1 | ( ( ( 3 === 2 ) ) )
in.t000066600000000121151334754530005347 0ustar00"foo" in "foobar" & '1' in ['1', 'foo'] & !('foo' in 'fo obar') & 'f' in ['foo']
lazyboolinvert.t000066600000000020151334754530010022 0ustar001 === 1 | !true
arrays.t000066600000000521151334754530006246 0ustar00array1 := [ 'a', 'b', 'c', ];
array2 := [];
array2[] := 'd';
array2[] := 'g';
array2[] := 'f';
array2[1] := 'e';

array3 := array1 + array2;
array4 := [ [ 1, 2, 3 ], [ 4, 5, 6 ] ];

(string(array3) == "a\nb\nc\nd\ne\nf\n" & !('b' in array2) & array1 contains 'c' & [ false, !(1;0), null ][1] & length(array3) == 6 &
	array4[1][1] == 5 )
rmwhitespace.t000066600000000140151334754530007435 0ustar00rmwhitespace( "foobar" ) === "foobar" &
rmwhitespace( "foo	bar bar    foo" ) === "foobarbarfoo"
wptest1.t000066600000000574151334754530006364 0ustar00/* Filter 30 from English Wikipedia (large deletion from article by new editors) */
user_groups_test := ["*"];
new_size_test := 100;
article_namespace_test := 0;
edit_delta_test := -5000;
added_lines_test := '';

!("autoconfirmed" in user_groups_test) & (new_size_test > 50) & (article_namespace_test == 0) &
	(edit_delta_test < -2000) & !("#redirect" in lcase(added_lines_test))
rcount.t000066600000000065151334754530006262 0ustar00rcount("a,b,c,d") === 4 &
rcount(".", "abcd") === 4

wptest3.t000066600000001605151334754530006362 0ustar00/* Filter 18 from English Wikipedia (test type edits from clicking on edit bar) */
user_groups_test := ["*"];
article_namespace_test := 0;
added_lines_test := ["Hello world! '''Bold text''' [http://www.example.com link title]"];

(article_namespace_test == 0) &
!("autoconfirmed" in user_groups_test) &
(contains_any(string(added_lines_test), 
	"'''Bold text'''", 
	"''Italic text''", 
	"[[Link title]]", 
	"[http://www.example.com link title]", 
	"== Headline text ==", 
	"[[File:Example.jpg]]", 
	"[[Media:Example.ogg]]", 
	"<math>Insert formula here</math>", 
	"<nowiki>Insert non-formatted text here</nowiki>", 
	"#REDIRECT [[Target page name]]", 
	"<s>Strike-through text</s>", 
	"<sup>Superscript text</sup>", 
	"<sub>Subscript text</sub>", 
	"<small>Small Text</small>", 
	"<!-- Comment -->", 
	"Image:Example.jpg|Caption", 
	"<ref>Insert footnote text here</ref>",
	"Ǣ ǣ ǖ ǘ ǚ ǜ Ă"
))

lcase.t000066600000000035151334754530006034 0ustar00lcase("FÁmí") === "fámí"
mwexamples-arrays.t000066600000000700151334754530010425 0ustar00/* Examples from [[mw:Extension:AbuseFilter/Rules format#Arrays]] */

my_array := [ 5, 6, 7, 10];
my_array[0] == 5 &
length(my_array) == 4 &
int( my_array ) === 4 &
float( my_array ) === 4.0 &
string(my_array) == "5\n6\n7\n10\n" &
5 in my_array == true &
'5' in my_array == true &
'5\n6' in my_array == true &
1 in my_array == true & (
my_array[] := 57;
my_array === [ 5, 6, 7, 10, 57 ]
) & (
my_array[2] := 42;
my_array === [ 5, 6, 42, 10, 57 ]
)
dundefined.t000066600000000024151334754530007050 0ustar00old_wikitext | true
mwexamples-keywords.t000066600000000412151334754530010773 0ustar00/* Examples from [[mw:Extension:AbuseFilter/Rules format#Keywords]] */

("1234" like "12?4") &
("1234" like "12*") &
("foo" in "foobar") &
("foobar" contains "foo") &
("o" in ["foo", "bar"]) &
("foo" regex "\w+") &
("a\b" regex "a\\\\b") &
("a\b" regex "a\x5C\x5Cb")lazypow.t000066600000000025151334754530006451 0ustar001 === 1 | 2**3 === 8
utf8.t000066600000000026151334754530005633 0ustar00length("áéý") == 3
dundefined-parens.t000066600000000026151334754530010340 0ustar00false | (var := 'foo')conditional-shortcircuit.t000066600000001415151334754530011773 0ustar00if ( 1 === 1 ) then
( var1 := 1 )
else
( var1 := 2 )
end;

var2 := 0;
if ( 1 === 1 ) then
( var2 := 1 )
else
( var2 := 2 )
end;

var4 := 'foo';
if ( 1=== 1 ) then
( var3 := 1; false & ( var4 := 'foobar' ) )
else
( var3 := 2 )
end;

if ( 1 === 1 ) then
( var5 := 1 )
else
( ( ( var5 := 2 ) ) )
end;


if ( 1 === 1 ) then
( var6 := 1 )
else
(
 if ( 1 == 1 ) then
  ( var6 := 2 )
 else
  ( var6 := 3 )
 end;
)
end;


var7 := 'foo';
if ( 1=== 1 ) then
(0)
else
( false & ( var7 := 'foobar' ) )
end;

var8 := 'foo';
false & (
  if ( 1 == 1 ) then
    (var8 := 3)
  else
    (var8 := 4)
  end;
);

var9 := 'foo';
if ( 1=== 1 ) then
  ( false & ( var9 := 'foobar' ) )
end;

var1 === 1 &
var2 === 1 &
var3 === 1 &
var5 === 1 &
var6 === 1 &
var7 === 'foo' &
var8 === 'foo' &
var9 === 'foo'
regex.t000066600000000264151334754530006063 0ustar00"foobér" rlike "^[fq]o{2}\\S.r$" &
"foo" regex "^f..?.$" &
"UPPERCASE" irlike "uppercase" &
"lowercase" irlike "LOWERCASE" &
"1234567" irlike "12345" &
"FoObAR" irlike "^[a-z]+$"
lazyfunction.t000066600000000042151334754530007470 0ustar001 === 1 | contains_any( "a", "b")
count.t000066600000000332151334754530006075 0ustar00count("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
shortcircuit-ops.t000066600000000075151334754530010272 0ustar00/* See T214642 */
!(1 = 0 & 1 < 3 * 24 * ( 3600 + 47 ) ** 2)
ucase.t000066600000000035151334754530006045 0ustar00ucase("FÁmí") === "FÁMÍ"
comment.t000066600000000056151334754530006412 0ustar001 /* a */ == /* b */ "1" /* c */ /* &

1/0
*/
contains.t000066600000000277151334754530006573 0ustar00"quux" contains "ux" &
['1', 'foo'] contains '1' &
'fo obar' contains 'foo' === false &
['foo'] contains 'f' &
'' contains 'a' === false &
'a' contains '' === false &
'' contains '' === falsewptest2.t000066600000002462151334754530006363 0ustar00/* 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)))
Back to Directory File Manager