aboutsummaryrefslogtreecommitdiffstats
path: root/tests/parser
diff options
context:
space:
mode:
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>2020-09-15 21:48:22 +0000
committerGerrit Code Review <gerrit@wikimedia.org>2020-09-15 21:48:22 +0000
commit13dc0e893dc3b787fc844b88acf2bbcb09a46fa1 (patch)
tree51173f29fe26b3b1810672cf00738dee054820d2 /tests/parser
parent448da261a20d176b0859435fc01ba84399b94375 (diff)
parentaeb3f45c20fc6a30b2d3858f668d1fa4a589213e (diff)
downloadmediawikicore-13dc0e893dc3b787fc844b88acf2bbcb09a46fa1.tar.gz
mediawikicore-13dc0e893dc3b787fc844b88acf2bbcb09a46fa1.zip
Merge "Tracking category and parser warning for deprecated uses of {{=}}"
Diffstat (limited to 'tests/parser')
-rw-r--r--tests/parser/ParserTestRunner.php1
-rw-r--r--tests/parser/parserTests.txt24
-rw-r--r--tests/parser/pfeqParserTests.txt30
3 files changed, 55 insertions, 0 deletions
diff --git a/tests/parser/ParserTestRunner.php b/tests/parser/ParserTestRunner.php
index 01786e2d93b7..a546e308e119 100644
--- a/tests/parser/ParserTestRunner.php
+++ b/tests/parser/ParserTestRunner.php
@@ -49,6 +49,7 @@ class ParserTestRunner {
*/
private static $coreTestFiles = [
'parserTests.txt',
+ 'pfeqParserTests.txt',
'extraParserTests.txt',
];
diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt
index 217d7646a354..8750793caa30 100644
--- a/tests/parser/parserTests.txt
+++ b/tests/parser/parserTests.txt
@@ -26340,6 +26340,30 @@ Special:Foobar
</p>
!! end
+# {{=}} will be converted to a parser function which expands to `=`
+# If you have it defined as a Template that expands to `=` that's ok;
+# and using it explicitly as {{Template:=}} (regardless of what it
+# expands to) is also ok and will not generate a tracking category.
+# T91154
+!! test
+Using {{=}} when it expands to "=" should not create a tracking category
+!! wikitext
+This uses {{=}} and {{Template:=}}.
+!! html
+<p>This uses = and =.
+</p>
+!! end
+
+# Repeat the test, looking at categories. Note: none should be emitted!
+!! test
+Using {{=}} when it expands to "=" should not create a tracking category (cat)
+!! options
+cat
+!! wikitext
+This uses {{=}} and {{Template:=}}.
+!! html/php
+!! end
+
!!test
T36939 - Case insensitive link parsing ([HttP://])
!! wikitext
diff --git a/tests/parser/pfeqParserTests.txt b/tests/parser/pfeqParserTests.txt
new file mode 100644
index 000000000000..6e56ca2f52ad
--- /dev/null
+++ b/tests/parser/pfeqParserTests.txt
@@ -0,0 +1,30 @@
+!! Version 2
+!! article
+Template:=
+!! text
+no
+!! endarticle
+
+# {{=}} will be converted to a parser function which expands to `=`
+# If you have it defined as a Template that expands to something other
+# than `=` that will generate a warning and a tracking category, although
+# referencing the template explicitly as {{Template:=}} is fine
+# regardless of what it expands to. (T91154)
+!! test
+Using {{=}} when that doesn't expand to "=" should create a tracking category
+!! options
+cat
+!! wikitext
+This uses {{=}}.
+!! html/php
+cat=Pages_which_use_=_as_a_template sort=
+!! end
+
+!! test
+Using {{Template:=}} shouldn't create tracking category regardless of definition
+!! options
+cat
+!! wikitext
+This uses {{Template:=}}.
+!! html/php
+!! end