From: Wil Mahan Date: Sat, 25 Sep 2004 21:20:32 +0000 (+0000) Subject: Work with $wgUseTidy again, and add more tests (we now have 100!) X-Git-Tag: 1.5.0alpha1~1790 X-Git-Url: http://git.cyclocoop.org/%24self?a=commitdiff_plain;h=282c3b0159b7ae6657b9963d8c769a71b6a93a53;p=lhc%2Fweb%2Fwiklou.git Work with $wgUseTidy again, and add more tests (we now have 100!) --- 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 +
[edit]

Section 0

+
[edit]

Section 1

+
[edit]

Section 2

+
[edit]

Section 4

+ +!! end + +!! test +__NOEDITSECTION__ keyword +!! input +__NOEDITSECTION__ +==Section 1== +==Section 2== +!! result +

Section 1

+

Section 2

+ +!! end + TODO: more images more tables