r13946 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r13945‎ | r13946 | r13947 >
Date:22:50, 29 April 2006
Author:brion
Status:old
Tags:
Comment:
add parser test case for bug 5757
test cases can now use 'language=xx' option
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/maintenance/parserTests.inc (modified) (history)
  • /trunk/phase3/maintenance/parserTests.txt (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/parserTests.inc
@@ -290,6 +290,14 @@
291291 if( !isset( $this->uploadDir ) ) {
292292 $this->uploadDir = $this->setupUploadDir();
293293 }
 294+
 295+ if( preg_match( '/language=([a-z]+(?:_[a-z]+)?)/', $opts, $m ) ) {
 296+ $lang = $m[1];
 297+ } else {
 298+ $lang = 'en';
 299+ }
 300+ $langClass = 'Language' . str_replace( '-', '_', ucfirst( $lang ) );
 301+ $langObj = setupLangObj( $langClass );
294302
295303 $settings = array(
296304 'wgServer' => 'http://localhost',
@@ -302,13 +310,13 @@
303311 'wgStyleSheetPath' => '/skins',
304312 'wgSitename' => 'MediaWiki',
305313 'wgServerName' => 'Britney Spears',
306 - 'wgLanguageCode' => 'en',
307 - 'wgContLanguageCode' => 'en',
 314+ 'wgLanguageCode' => $lang,
 315+ 'wgContLanguageCode' => $lang,
308316 'wgDBprefix' => 'parsertest_',
309317 'wgDefaultUserOptions' => array(),
310318
311 - 'wgLang' => new LanguageUtf8(),
312 - 'wgContLang' => new LanguageUtf8(),
 319+ 'wgLang' => $langObj,
 320+ 'wgContLang' => $langObj,
313321 'wgNamespacesWithSubpages' => array( 0 => preg_match('/\\bsubpage\\b/i', $opts)),
314322 'wgMaxTocLevel' => 999,
315323 'wgCapitalLinks' => true,
Index: trunk/phase3/maintenance/parserTests.txt
@@ -18,6 +18,7 @@
1919 # subpage enable subpages (disabled by default)
2020 # noxml don't check for XML well formdness
2121 # title=[[XXX]] run test using article title XXX
 22+# language=XXX set content language to XXX for this test
2223 # disabled do not run test
2324 #
2425 # For testing purposes, temporary articles can created:
@@ -3754,6 +3755,27 @@
37553756 Something, but defenetly not <br id="9" />...
37563757 !! end
37573758
 3759+!! test
 3760+Language converter: output gets cut off unexpectedly (bug 5757)
 3761+!! options
 3762+language=zh
 3763+!! input
 3764+this bit is safe: }-
 3765+
 3766+but if we add a conversion instance: -{zh-cn:xxx;zh-tw:yyy}-
 3767+
 3768+then we get cut off here: }-
 3769+
 3770+all additional text is vanished
 3771+!! result
 3772+<p>this bit is safe: }-
 3773+</p><p>but if we add a conversion instance: xxx
 3774+</p><p>then we get cut off here: }-
 3775+</p><p>all additional text is vanished
 3776+</p>
 3777+!! end
 3778+
 3779+
37583780 TODO:
37593781 more images
37603782 more tables
Index: trunk/phase3/RELEASE-NOTES
@@ -147,7 +147,9 @@
148148 * Cleaned up formatNum usage in langfiles
149149 * (bug 5716) Warn when a user tries to upload a file which was previously deleted
150150 * (bug 5565) Add a class attribute to the table on Special:Allpages
 151+* "lang=xx" option for parser test cases to set content language
151152
 153+
152154 == Compatibility ==
153155
154156 Older PHP 4.2 and 4.1 releases are no longer supported; PHP 4 users must

Follow-up revisions

RevisionCommit summaryAuthorDate
r13948* (bug 5757) Fix premature cutoff in LanguageConverter with extra end markersbrion23:24, 29 April 2006

Status & tagging log