From 282c3b0159b7ae6657b9963d8c769a71b6a93a53 Mon Sep 17 00:00:00 2001
From: Wil Mahan
Date: Sat, 25 Sep 2004 21:20:32 +0000
Subject: [PATCH] Work with $wgUseTidy again, and add more tests (we now have
100!)
---
maintenance/parserTests.php | 3 +-
maintenance/parserTests.txt | 85 +++++++++++++++++++++++++++++++++++--
2 files changed, 84 insertions(+), 4 deletions(-)
diff --git a/maintenance/parserTests.php b/maintenance/parserTests.php
index 6394bae214..06e50bcf0f 100644
--- a/maintenance/parserTests.php
+++ b/maintenance/parserTests.php
@@ -232,6 +232,7 @@ class ParserTest {
}
if ($GLOBALS['wgUseTidy']) {
+ $out = Parser::tidy($out);
$result = Parser::tidy($result);
}
}
@@ -265,7 +266,7 @@ class ParserTest {
'wgLoadBalancer' => LoadBalancer::newFromParams( $GLOBALS['wgDBservers'] ),
'wgLang' => new LanguageUtf8(),
- 'wgNamespacesWithSubpages' => array( 0 => preg_match('/subpage/i', $opts)),
+ 'wgNamespacesWithSubpages' => array( 0 => preg_match('/\\bsubpage\\b/i', $opts)),
);
$this->savedGlobals = array();
foreach( $settings as $var => $val ) {
diff --git a/maintenance/parserTests.txt b/maintenance/parserTests.txt
index 6ebdeea1ca..eef122866d 100644
--- a/maintenance/parserTests.txt
+++ b/maintenance/parserTests.txt
@@ -5,9 +5,14 @@
# The syntax should be fairly self-explanatory.
#
# Currently supported test options:
+# One of the following three:
+#
# (default) generate HTML output
# pst apply pre-save transform
# msg apply message transform
+#
+# Plus any combination of these:
+#
# cat add category links
# ill add inter-language links
# subpage enable subpages (disabled by default)
@@ -1016,6 +1021,14 @@ Template infinite loop
!! end
+!! test
+Template from main namespace
+!! input
+{{:Main Page}}
+!! result
+blah blah
+
+!! end
!! article
Template:table
@@ -1071,6 +1084,38 @@ BUG 41: Template parameters shown as broken links
!! end
+
+!! article
+Template:MSGNW test
+!! text
+''None'' of '''this''' should be
+* interepreted
+ but rather passed unmodified
+{{test}}
+!! endarticle
+
+# hmm, fix this or just disable/deprecate msgnw?
+!! test
+msgnw keyword
+!! input
+{{msgnw:MSGNW test}}
+!! result
+''None'' of '''this''' should be
+* interepreted
+ but rather passed unmodified
+{{test}}
+
+!! end
+
+!! test
+int keyword
+!! input
+{{int:newmessages|lots of money}}
+!! result
+You have lots of money.
+
+!! end
+
###
### Pre-save transform tests
###
@@ -1228,20 +1273,19 @@ subpage title=[[Subpage test]]
!! end
-# bug 561: it would be nice if this linked to /subpage -- wtm
!! test
Disabled subpages
!! input
[[/subpage]]
!! result
-subpage
+
/subpage
!! end
!! test
BUG 561: {{/Subpage}}
!! options
-title=[[Page]]
+subpage title=[[Page]]
!! input
{{/Subpage}}
!! result
@@ -1374,6 +1418,41 @@ Resolving duplicate section names
!! end
+!! article
+Template:sections
+!! text
+===Section 1===
+==Section 2==
+!! endarticle
+
+!! test
+Template with sections, __NOTOC__
+!! options title=[[Parser test script]]
+!! input
+__NOTOC__
+==Section 0==
+{{sections}}
+==Section 4==
+!! result
+Section 0
+Section 1
+Section 2
+Section 4
+
+!! end
+
+!! test
+__NOEDITSECTION__ keyword
+!! input
+__NOEDITSECTION__
+==Section 1==
+==Section 2==
+!! result
+Section 1
+Section 2
+
+!! end
+
TODO:
more images
more tables
--
2.20.1