From c36bdd8caec4646978be6791dbaf06f0d1891e01 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sat, 29 Apr 2006 22:50:13 +0000 Subject: [PATCH] add parser test case for bug 5757 test cases can now use 'language=xx' option --- RELEASE-NOTES | 2 ++ maintenance/parserTests.inc | 16 ++++++++++++---- maintenance/parserTests.txt | 22 ++++++++++++++++++++++ 3 files changed, 36 insertions(+), 4 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 0757894020..fa8fe1becc 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -147,6 +147,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * Cleaned up formatNum usage in langfiles * (bug 5716) Warn when a user tries to upload a file which was previously deleted * (bug 5565) Add a class attribute to the table on Special:Allpages +* "lang=xx" option for parser test cases to set content language + == Compatibility == diff --git a/maintenance/parserTests.inc b/maintenance/parserTests.inc index 12e7dc8c84..e16be32d0a 100644 --- a/maintenance/parserTests.inc +++ b/maintenance/parserTests.inc @@ -290,6 +290,14 @@ class ParserTest { if( !isset( $this->uploadDir ) ) { $this->uploadDir = $this->setupUploadDir(); } + + if( preg_match( '/language=([a-z]+(?:_[a-z]+)?)/', $opts, $m ) ) { + $lang = $m[1]; + } else { + $lang = 'en'; + } + $langClass = 'Language' . str_replace( '-', '_', ucfirst( $lang ) ); + $langObj = setupLangObj( $langClass ); $settings = array( 'wgServer' => 'http://localhost', @@ -302,13 +310,13 @@ class ParserTest { 'wgStyleSheetPath' => '/skins', 'wgSitename' => 'MediaWiki', 'wgServerName' => 'Britney Spears', - 'wgLanguageCode' => 'en', - 'wgContLanguageCode' => 'en', + 'wgLanguageCode' => $lang, + 'wgContLanguageCode' => $lang, 'wgDBprefix' => 'parsertest_', 'wgDefaultUserOptions' => array(), - 'wgLang' => new LanguageUtf8(), - 'wgContLang' => new LanguageUtf8(), + 'wgLang' => $langObj, + 'wgContLang' => $langObj, 'wgNamespacesWithSubpages' => array( 0 => preg_match('/\\bsubpage\\b/i', $opts)), 'wgMaxTocLevel' => 999, 'wgCapitalLinks' => true, diff --git a/maintenance/parserTests.txt b/maintenance/parserTests.txt index ddd1232441..b692b088fe 100644 --- a/maintenance/parserTests.txt +++ b/maintenance/parserTests.txt @@ -18,6 +18,7 @@ # subpage enable subpages (disabled by default) # noxml don't check for XML well formdness # title=[[XXX]] run test using article title XXX +# language=XXX set content language to XXX for this test # disabled do not run test # # For testing purposes, temporary articles can created: @@ -3754,6 +3755,27 @@ disabled Something, but defenetly not
... !! end +!! test +Language converter: output gets cut off unexpectedly (bug 5757) +!! options +language=zh +!! input +this bit is safe: }- + +but if we add a conversion instance: -{zh-cn:xxx;zh-tw:yyy}- + +then we get cut off here: }- + +all additional text is vanished +!! result +

this bit is safe: }- +

but if we add a conversion instance: xxx +

then we get cut off here: }- +

all additional text is vanished +

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