https://www.mediawiki.org/wiki/Special:Code/MediaWiki/113350

Revision: 113350
Author:   santhosh
Date:     2012-03-08 08:49:42 +0000 (Thu, 08 Mar 2012)
Log Message:
-----------
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
    
branches/jsgrammar/tests/qunit/suites/resources/mediawiki/mediawiki.language.test.js

Modified: branches/jsgrammar/tests/qunit/index.html
===================================================================
--- branches/jsgrammar/tests/qunit/index.html   2012-03-08 08:34:28 UTC (rev 
113349)
+++ branches/jsgrammar/tests/qunit/index.html   2012-03-08 08:49:42 UTC (rev 
113350)
@@ -119,6 +119,7 @@
        <script src="suites/resources/jquery/jquery.textSelection.test.js" 
charset="UTF-8"></script>
        <script 
src="suites/resources/mediawiki/mediawiki.Title.test.js"></script>
        <script 
src="suites/resources/mediawiki/mediawiki.jqueryMsg.test.js"></script>
+       <script 
src="suites/resources/mediawiki/mediawiki.language.test.js"></script>
        <script 
src="suites/resources/mediawiki.special/mediawiki.special.recentchanges.test.js"></script>
 </head>
 <body>

Modified: 
branches/jsgrammar/tests/qunit/suites/resources/mediawiki/mediawiki.language.test.js
===================================================================
--- 
branches/jsgrammar/tests/qunit/suites/resources/mediawiki/mediawiki.language.test.js
        2012-03-08 08:34:28 UTC (rev 113349)
+++ 
branches/jsgrammar/tests/qunit/suites/resources/mediawiki/mediawiki.language.test.js
        2012-03-08 08:49:42 UTC (rev 113350)
@@ -5,24 +5,24 @@
        ok( mw.language, 'mw.language defined' );
 } );
 
-mw.language.grammartest = function( options ) {
+var grammartest = function( options ) {
        var opt = $.extend({
                language: '',
                test: []
-       }, options);
+       }, options );
        // The test works only if the content language is opt.language
        // because it requires [lang].js to be loaded.
        if( mw.config.get ( 'wgContentLanguage' ) === opt.language ) {
                test( "-- Grammar Test for "+ opt.language, function() {
-                       expect( opt.test.length);
+                       expect( opt.test.length );
                        for ( var i= 0 ; i < opt.test.length; i++ ) {
-                               equal( mw.language.convertGrammar(  
opt.test[i].word, opt.test[i].grammarForm ), opt.test[i].expected, 
opt.test[i].description );
+                               equal( mw.language.convertGrammar( 
opt.test[i].word, opt.test[i].grammarForm ), opt.test[i].expected, 
opt.test[i].description );
                        }
                } );
        }
 }
 
-mw.language.grammartest({
+grammartest({
        language: 'bs',
        test: [
                { word: 'word', grammarForm: 'instrumental', expected: 's 
word', description: 'Grammar test for Bosnian, instrumental case' },
@@ -30,7 +30,7 @@
        ]
 });
 
-mw.language.grammartest({
+grammartest({
        language: 'he',
        test: [
                { word: "ויקיפדיה", grammarForm: 'prefixed', expected: 
"וויקיפדיה", description: 'Grammar test for Hebrew, Duplicate the "Waw" if 
prefixed' },
@@ -41,7 +41,7 @@
        ]
 });
 
-mw.language.grammartest({
+grammartest({
        language: 'hsb',
        test: [
                { word: 'word', grammarForm: 'instrumental', expected: 'z 
word', description: 'Grammar test for Upper Sorbian, instrumental case' },
@@ -49,7 +49,7 @@
        ]
 });
 
-mw.language.grammartest({
+grammartest({
        language: 'dsb',
        test: [
                { word: 'word', grammarForm: 'instrumental', expected: 'z 
word', description: 'Grammar test for Lower Sorbian, instrumental case' },
@@ -57,7 +57,7 @@
        ]
 });
 
-mw.language.grammartest({
+grammartest({
        language: 'hy',
        test: [
                { word: 'Մաունա', grammarForm: 'genitive', expected: 
'Մաունայի', description: 'Grammar test for Armenian, genitive case' },
@@ -67,7 +67,7 @@
        ]
 });
 
-mw.language.grammartest({
+grammartest({
        language: 'fi',
        test: [
                { word: 'talo', grammarForm: 'genitive', expected: 'talon', 
description: 'Grammar test for Finnish, genitive case' },
@@ -80,7 +80,7 @@
        ]
 });
 
-mw.language.grammartest({
+grammartest({
        language: 'ru',
        test: [
                { word: 'тесть', grammarForm: 'genitive', expected: 'тестя', 
description: 'Grammar test for Russian, genitive case' },
@@ -92,7 +92,7 @@
        ]
 });
 
-mw.language.grammartest({
+grammartest({
        language: 'hu',
        test: [
                { word: 'Wikipédiá', grammarForm: 'rol', expected: 
'Wikipédiáról', description: 'Grammar test for Hungarian, rol case' },
@@ -101,7 +101,7 @@
        ]
 });
 
-mw.language.grammartest({
+grammartest({
        language: 'ga',
        test: [
                { word: 'an Domhnach', grammarForm: 'ainmlae', expected: 'Dé 
Domhnaigh', description: 'Grammar test for Irish, ainmlae case' },
@@ -110,7 +110,7 @@
        ]
 });
 
-mw.language.grammartest({
+grammartest({
        language: 'uk',
        test: [
                { word: 'тесть', grammarForm: 'genitive', expected: 'тестя', 
description: 'Grammar test for Ukrainian, genitive case' },
@@ -124,7 +124,7 @@
 });
 
 
-mw.language.grammartest({
+grammartest({
        language: 'sl',
        test: [
                { word: 'word', grammarForm: 'orodnik', expected: 'z word', 
description: 'Grammar test for Slovenian, orodnik case' },
@@ -132,7 +132,7 @@
        ]
 });
 
-mw.language.grammartest({
+grammartest({
        language: 'os',
        test: [
                { word: 'бæстæ', grammarForm: 'genitive', expected: 'бæсты', 
description: 'Grammar test for Ossetian, genitive case' },
@@ -144,7 +144,7 @@
        ]
 });
 
-mw.language.grammartest({
+grammartest({
        language: 'la',
        test: [
                { word: 'Translatio', grammarForm: 'genitive', expected: 
'Translationis', description: 'Grammar test for Latin, genitive case' },


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to