r65973 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r65972‎ | r65973 | r65974 >
Date:23:54, 5 May 2010
Author:mah
Status:deferred (Comments)
Tags:
Comment:
fix logic error that spews warnings in r65905
Modified paths:
  • /trunk/phase3/maintenance/parserTests.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/parserTests.inc
@@ -298,7 +298,7 @@
299299 if ( $this->showProgress ) {
300300 print "\n";
301301 }
302 - return $ok;
 302+ return $ok;
303303 }
304304
305305 /**
@@ -352,7 +352,7 @@
353353
354354 $noxml = isset( $opts['noxml'] );
355355 $local = isset( $opts['local'] );
356 - $preprocessor = @$opts['preprocessor'];
 356+ $preprocessor = isset( $opts['preprocessor'] ) ? $opts['preprocessor'] : null;
357357 $parser = $this->getParser( $preprocessor );
358358 $title = Title::newFromText( $titleText );
359359
@@ -1638,8 +1638,10 @@
16391639 if( !isset( $data['article'] ) ) {
16401640 wfDie( "'endarticle' without 'article' at line {$this->lineNum} of $filename\n" );
16411641 }
1642 - if( $this->parser ) $this->parser->addArticle($this->parser->chomp($data['article']), $this->parser->chomp($data['text']),
1643 - $this->lineNum);
 1642+ if( $this->parser ) {
 1643+ $this->parser->addArticle($this->parser->chomp($data['article']), $this->parser->chomp($data['text']),
 1644+ $this->lineNum);
 1645+ }
16441646 $data = array();
16451647 $section = null;
16461648 continue;
@@ -1688,8 +1690,9 @@
16891691 if (!isset( $data['config'] ) )
16901692 $data['config'] = '';
16911693
1692 - if ( $this->parser && (preg_match('/\\bdisabled\\b/i', $data['options']) && !$this->parser->runDisabled)
1693 - || !preg_match("/{$this->parser->regex}/i", $data['test']) ) {
 1694+ if ( $this->parser
 1695+ && ((preg_match('/\\bdisabled\\b/i', $data['options']) && !$this->parser->runDisabled)
 1696+ || !preg_match("/".$this->parser->regex."/i", $data['test'])) ) {
16941697 # disabled test
16951698 $data = array();
16961699 $section = null;

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r65905Specifying --run-disabled with --regex should run the tests matching the rege...platonides16:03, 4 May 2010

Comments

#Comment by MarkAHershberger (talk | contribs)   23:58, 5 May 2010

This also replaces the use '@' in r65967 -- forgot to note that in the commit.

Status & tagging log