r99289 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99288‎ | r99289 | r99290 >
Date:00:27, 8 October 2011
Author:brion
Status:ok
Tags:
Comment:

followup r99246: fixes for test cases
Modified paths:
  • /trunk/phase3/tests/parser/bug31490.txt (modified) (history)
  • /trunk/phase3/tests/parser/parserTests.txt (modified) (history)
  • /trunk/phase3/tests/phpunit/languages/LanguageTrTest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/phpunit/languages/LanguageTrTest.php
@@ -16,40 +16,13 @@
1717 unset( $this->lang );
1818 }
1919
20 -##### Full Turkish alphabet #################################################
21 -
22 - function testLowerCaseTurkishAlphabetToUppercase() {
23 - $this->assertEquals( 'ABCÇDEFGĞHIİJKLMNOÖPRSŞTUÜVYZ',
24 - $this->lang->uc( 'abcçdefgğhıijklmnoöprsştuüvyz' ),
25 - 'Lower case Turkish alphabet to upper case'
26 - );
27 - }
28 - function testUpperCaseTurkishAlphabetToUppercase() {
29 - $this->assertEquals( 'ABCÇDEFGĞHIİJKLMNOÖPRSŞTUÜVYZ',
30 - $this->lang->uc( 'ABCÇDEFGĞHIİJKLMNOÖPRSŞTUÜVYZ' ),
31 - 'Upper case Turkish alphabet to upper case'
32 - );
33 - }
34 - function testUpperCaseTurkishAlphabetToLowercase() {
35 - $this->assertEquals( 'abcçdefgğhıijklmnoöprsştuüvyz',
36 - $this->lang->lc( 'ABCÇDEFGĞHIİJKLMNOÖPRSŞTUÜVYZ' ),
37 - 'Upper case Turkish alphabet to lower case'
38 - );
39 - }
40 - function testLowerCaseTurkishAlphabetToLowercase() {
41 - $this->assertEquals( 'abcçdefgğhıijklmnoöprsştuüvyz',
42 - $this->lang->lc( 'abcçdefgğhıijklmnoöprsştuüvyz' ),
43 - 'Lower case Turkish alphabet to lower case'
44 - );
45 - }
46 -
4720 /**
4821 * See @bug 28040
4922 * Credits to #wikipedia-tr users berm, []LuCkY[] and Emperyan
5023 * @see http://en.wikipedia.org/wiki/Dotted_and_dotless_I
5124 * @dataProvider provideDottedAndDotlessI
5225 */
53 - function testChangeCaseOfFirstCharBeingDottedAndDotlessI( $func, $input, $inputCase, $expected ) {
 26+ function testDottedAndDotlessI( $func, $input, $inputCase, $expected ) {
5427 if( $func == 'ucfirst' ) {
5528 $res = $this->lang->ucfirst( $input );
5629 } elseif( $func == 'lcfirst' ) {
@@ -87,60 +60,6 @@
8861 array( 'lcfirst', 'IPhone', 'upper', 'ıPhone' ),
8962
9063 );
91 - }
92 -
93 -##### LanguageTr specificities #############################################
94 - /**
95 - * @cover LanguageTr:lc
96 - * See @bug 28040
97 - */
98 - function testLanguageTrLowerCasingOverride() {
99 - $this->assertEquals( 'ııııı', $this->lang->lc( 'IIIII') );
10064 }
101 - /**
102 - * @cover LanguageTr:uc
103 - * See @bug 28040
104 - */
105 - function testLanguageTrUpperCasingOverride() {
106 - $this->assertEquals( 'İİİİİ', $this->lang->uc( 'iiiii') );
107 - }
10865
109 -##### Upper casing a string #################################################
110 - /**
111 - * Generic test for the Turkish dotted and dotless I strings
112 - * See @bug 28040
113 - * @dataProvider provideUppercaseStringsWithDottedAndDotlessI
114 - */
115 - function testUpperCasingOfAStringWithDottedAndDotLessI( $expected, $input ) {
116 - $this->assertEquals( $expected, $this->lang->uc( $input ) );
117 - }
118 - function provideUppercaseStringsWithDottedAndDotlessI() {
119 - return array(
120 - # expected, input string to uc()
121 - array( 'IIIII', 'ııııı' ),
122 - array( 'IIIII', 'IIIII' ), #identity
123 - array( 'İİİİİ', 'iiiii' ), # Specifically handled by LanguageTr:uc
124 - array( 'İİİİİ', 'İİİİİ' ), #identity
125 - );
126 - }
127 -
128 -##### Lower casing a string #################################################
129 - /**
130 - * Generic test for the Turkish dotted and dotless I strings
131 - * See @bug 28040
132 - * @dataProvider provideLowercaseStringsWithDottedAndDotlessI
133 - */
134 - function testLowerCasingOfAStringWithDottedAndDotLessI( $expected, $input ) {
135 - $this->assertEquals( $expected, $this->lang->lc( $input ) );
136 - }
137 - function provideLowercaseStringsWithDottedAndDotlessI() {
138 - return array(
139 - # expected, input string to lc()
140 - array( 'ııııı', 'IIIII' ), # Specifically handled by LanguageTr:lc
141 - array( 'ııııı', 'ııııı' ), #identity
142 - array( 'iiiii', 'İİİİİ' ),
143 - array( 'iiiii', 'iiiii' ), #identity
144 - );
145 - }
146 -
14766 }
Index: trunk/phase3/tests/parser/bug31490.txt
@@ -16,7 +16,7 @@
1717 !! input
1818 {{ucfirst:ix}}
1919 !! result
20 -<p>Ix
 20+<p>İx
2121 </p>
2222 !! end
2323
@@ -38,7 +38,7 @@
3939 !! input
4040 {{ucfırst:blah}}
4141 !! result
42 -<p><a href="https://www.mediawiki.org/index.php?title=Template:Ucf%C4%B1rst:blah&amp;action=edit&amp;redlink=1" class="new" title="Template:Ucfırst:blah (page does not exist)">Template:Ucfırst:blah</a>
 42+<p><a href="https://www.mediawiki.org/index.php?title=%C5%9Eablon:Ucf%C4%B1rst:blah&amp;action=edit&amp;redlink=1" class="new" title="Şablon:Ucfırst:blah (sayfa mevcut değil)">Şablon:Ucfırst:blah</a>
4343 </p>
4444 !! end
4545
Index: trunk/phase3/tests/parser/parserTests.txt
@@ -8815,6 +8815,61 @@
88168816
88178817 !! end
88188818
 8819+!! test
 8820+Bug31490 Turkish: ucfirst 'blah'
 8821+!! options
 8822+language=tr
 8823+!! input
 8824+{{ucfirst:blah}}
 8825+!! result
 8826+<p>Blah
 8827+</p>
 8828+!! end
 8829+
 8830+!! test
 8831+Bug31490 Turkish: ucfirst 'ix'
 8832+!! options
 8833+language=tr
 8834+!! input
 8835+{{ucfirst:ix}}
 8836+!! result
 8837+<p>İx
 8838+</p>
 8839+!! end
 8840+
 8841+!! test
 8842+Bug31490 Turkish: lcfirst 'BLAH'
 8843+!! options
 8844+language=tr
 8845+!! input
 8846+{{lcfirst:BLAH}}
 8847+!! result
 8848+<p>bLAH
 8849+</p>
 8850+!! end
 8851+
 8852+!! test
 8853+Bug31490 Turkish: ucfırst (with a dotless i)
 8854+!! options
 8855+language=tr
 8856+!! input
 8857+{{ucfırst:blah}}
 8858+!! result
 8859+<p><a href="https://www.mediawiki.org/index.php?title=%C5%9Eablon:Ucf%C4%B1rst:blah&amp;action=edit&amp;redlink=1" class="new" title="Şablon:Ucfırst:blah (sayfa mevcut değil)">Şablon:Ucfırst:blah</a>
 8860+</p>
 8861+!! end
 8862+
 8863+!! test
 8864+Bug31490 ucfırst (with a dotless i) with English language
 8865+!! options
 8866+language=en
 8867+!! input
 8868+{{ucfırst:blah}}
 8869+!! result
 8870+<p><a href="https://www.mediawiki.org/index.php?title=Template:Ucf%C4%B1rst:blah&amp;action=edit&amp;redlink=1" class="new" title="Template:Ucfırst:blah (page does not exist)">Template:Ucfırst:blah</a>
 8871+</p>
 8872+!! end
 8873+
88198874 TODO:
88208875 more images
88218876 more tables

Follow-up revisions

RevisionCommit summaryAuthorDate
r99290Revert r84057, r84080, part of r99074: lc() and uc() custom handling for Turk...brion00:30, 8 October 2011
r99291MFT r99289, r99290: rolls back Turkish uc()/lc() support for dotless/dotted i...brion00:36, 8 October 2011
r99292MFT r99289, r99290: rolls back Turkish uc()/lc() support for dotless/dotted i...brion00:37, 8 October 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r99246Tests for bug 31490 : turkish magic word with a 'i' are broken :d...hashar20:18, 7 October 2011

Status & tagging log