r113350 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r113349‎ | r113350 | r113351 >
Date:08:49, 8 March 2012
Author:santhosh
Status:ok
Tags:
Comment:
Add the test to qunit/index.html
White space fixes,
just use local grammartest instead of mw.language.grammartest.
Ping r111724
Modified paths:
  • /branches/jsgrammar/tests/qunit/index.html (modified) (history)
  • /branches/jsgrammar/tests/qunit/suites/resources/mediawiki/mediawiki.language.test.js (modified) (history)

Diff [purge]

Index: branches/jsgrammar/tests/qunit/index.html
@@ -119,6 +119,7 @@
120120 <script src="suites/resources/jquery/jquery.textSelection.test.js" charset="UTF-8"></script>
121121 <script src="suites/resources/mediawiki/mediawiki.Title.test.js"></script>
122122 <script src="suites/resources/mediawiki/mediawiki.jqueryMsg.test.js"></script>
 123+ <script src="suites/resources/mediawiki/mediawiki.language.test.js"></script>
123124 <script src="suites/resources/mediawiki.special/mediawiki.special.recentchanges.test.js"></script>
124125 </head>
125126 <body>
Index: branches/jsgrammar/tests/qunit/suites/resources/mediawiki/mediawiki.language.test.js
@@ -5,24 +5,24 @@
66 ok( mw.language, 'mw.language defined' );
77 } );
88
9 -mw.language.grammartest = function( options ) {
 9+var grammartest = function( options ) {
1010 var opt = $.extend({
1111 language: '',
1212 test: []
13 - }, options);
 13+ }, options );
1414 // The test works only if the content language is opt.language
1515 // because it requires [lang].js to be loaded.
1616 if( mw.config.get ( 'wgContentLanguage' ) === opt.language ) {
1717 test( "-- Grammar Test for "+ opt.language, function() {
18 - expect( opt.test.length);
 18+ expect( opt.test.length );
1919 for ( var i= 0 ; i < opt.test.length; i++ ) {
20 - equal( mw.language.convertGrammar( opt.test[i].word, opt.test[i].grammarForm ), opt.test[i].expected, opt.test[i].description );
 20+ equal( mw.language.convertGrammar( opt.test[i].word, opt.test[i].grammarForm ), opt.test[i].expected, opt.test[i].description );
2121 }
2222 } );
2323 }
2424 }
2525
26 -mw.language.grammartest({
 26+grammartest({
2727 language: 'bs',
2828 test: [
2929 { word: 'word', grammarForm: 'instrumental', expected: 's word', description: 'Grammar test for Bosnian, instrumental case' },
@@ -30,7 +30,7 @@
3131 ]
3232 });
3333
34 -mw.language.grammartest({
 34+grammartest({
3535 language: 'he',
3636 test: [
3737 { word: "ויקיפדיה", grammarForm: 'prefixed', expected: "וויקיפדיה", description: 'Grammar test for Hebrew, Duplicate the "Waw" if prefixed' },
@@ -41,7 +41,7 @@
4242 ]
4343 });
4444
45 -mw.language.grammartest({
 45+grammartest({
4646 language: 'hsb',
4747 test: [
4848 { word: 'word', grammarForm: 'instrumental', expected: 'z word', description: 'Grammar test for Upper Sorbian, instrumental case' },
@@ -49,7 +49,7 @@
5050 ]
5151 });
5252
53 -mw.language.grammartest({
 53+grammartest({
5454 language: 'dsb',
5555 test: [
5656 { word: 'word', grammarForm: 'instrumental', expected: 'z word', description: 'Grammar test for Lower Sorbian, instrumental case' },
@@ -57,7 +57,7 @@
5858 ]
5959 });
6060
61 -mw.language.grammartest({
 61+grammartest({
6262 language: 'hy',
6363 test: [
6464 { word: 'Մաունա', grammarForm: 'genitive', expected: 'Մաունայի', description: 'Grammar test for Armenian, genitive case' },
@@ -67,7 +67,7 @@
6868 ]
6969 });
7070
71 -mw.language.grammartest({
 71+grammartest({
7272 language: 'fi',
7373 test: [
7474 { word: 'talo', grammarForm: 'genitive', expected: 'talon', description: 'Grammar test for Finnish, genitive case' },
@@ -80,7 +80,7 @@
8181 ]
8282 });
8383
84 -mw.language.grammartest({
 84+grammartest({
8585 language: 'ru',
8686 test: [
8787 { word: 'тесть', grammarForm: 'genitive', expected: 'тестя', description: 'Grammar test for Russian, genitive case' },
@@ -92,7 +92,7 @@
9393 ]
9494 });
9595
96 -mw.language.grammartest({
 96+grammartest({
9797 language: 'hu',
9898 test: [
9999 { word: 'Wikipédiá', grammarForm: 'rol', expected: 'Wikipédiáról', description: 'Grammar test for Hungarian, rol case' },
@@ -101,7 +101,7 @@
102102 ]
103103 });
104104
105 -mw.language.grammartest({
 105+grammartest({
106106 language: 'ga',
107107 test: [
108108 { word: 'an Domhnach', grammarForm: 'ainmlae', expected: 'Dé Domhnaigh', description: 'Grammar test for Irish, ainmlae case' },
@@ -110,7 +110,7 @@
111111 ]
112112 });
113113
114 -mw.language.grammartest({
 114+grammartest({
115115 language: 'uk',
116116 test: [
117117 { word: 'тесть', grammarForm: 'genitive', expected: 'тестя', description: 'Grammar test for Ukrainian, genitive case' },
@@ -124,7 +124,7 @@
125125 });
126126
127127
128 -mw.language.grammartest({
 128+grammartest({
129129 language: 'sl',
130130 test: [
131131 { word: 'word', grammarForm: 'orodnik', expected: 'z word', description: 'Grammar test for Slovenian, orodnik case' },
@@ -132,7 +132,7 @@
133133 ]
134134 });
135135
136 -mw.language.grammartest({
 136+grammartest({
137137 language: 'os',
138138 test: [
139139 { word: 'бæстæ', grammarForm: 'genitive', expected: 'бæсты', description: 'Grammar test for Ossetian, genitive case' },
@@ -144,7 +144,7 @@
145145 ]
146146 });
147147
148 -mw.language.grammartest({
 148+grammartest({
149149 language: 'la',
150150 test: [
151151 { word: 'Translatio', grammarForm: 'genitive', expected: 'Translationis', description: 'Grammar test for Latin, genitive case' },

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r111724Qunit Testcases for mediawiki.language. For now, just one test for convertGra...santhosh04:38, 17 February 2012

Status & tagging log