mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-12-25 20:12:55 +00:00
39fc7c12af
Added cachingParser back to *all* the parser tests, fixed a couple of differences with the normal parser, and added a couple of tests so that any cachingParser-related file has 100% coverage. Also move the remaining get_matches tests inside parserTests, and specify the parser used in case of failure. This also adds a new base class for parser-related tests with a couple of util methods. Bug: T201193 Change-Id: I980aec3481a52ecc35f1811a366014a5581a7cdb
5 lines
701 B
Perl
5 lines
701 B
Perl
get_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 ] |