Index: branches/jsgrammar/tests/qunit/index.html |
— | — | @@ -119,6 +119,7 @@ |
120 | 120 | <script src="suites/resources/jquery/jquery.textSelection.test.js" charset="UTF-8"></script> |
121 | 121 | <script src="suites/resources/mediawiki/mediawiki.Title.test.js"></script> |
122 | 122 | <script src="suites/resources/mediawiki/mediawiki.jqueryMsg.test.js"></script> |
| 123 | + <script src="suites/resources/mediawiki/mediawiki.language.test.js"></script> |
123 | 124 | <script src="suites/resources/mediawiki.special/mediawiki.special.recentchanges.test.js"></script> |
124 | 125 | </head> |
125 | 126 | <body> |
Index: branches/jsgrammar/tests/qunit/suites/resources/mediawiki/mediawiki.language.test.js |
— | — | @@ -5,24 +5,24 @@ |
6 | 6 | ok( mw.language, 'mw.language defined' ); |
7 | 7 | } ); |
8 | 8 | |
9 | | -mw.language.grammartest = function( options ) { |
| 9 | +var grammartest = function( options ) { |
10 | 10 | var opt = $.extend({ |
11 | 11 | language: '', |
12 | 12 | test: [] |
13 | | - }, options); |
| 13 | + }, options ); |
14 | 14 | // The test works only if the content language is opt.language |
15 | 15 | // because it requires [lang].js to be loaded. |
16 | 16 | if( mw.config.get ( 'wgContentLanguage' ) === opt.language ) { |
17 | 17 | test( "-- Grammar Test for "+ opt.language, function() { |
18 | | - expect( opt.test.length); |
| 18 | + expect( opt.test.length ); |
19 | 19 | 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 ); |
21 | 21 | } |
22 | 22 | } ); |
23 | 23 | } |
24 | 24 | } |
25 | 25 | |
26 | | -mw.language.grammartest({ |
| 26 | +grammartest({ |
27 | 27 | language: 'bs', |
28 | 28 | test: [ |
29 | 29 | { word: 'word', grammarForm: 'instrumental', expected: 's word', description: 'Grammar test for Bosnian, instrumental case' }, |
— | — | @@ -30,7 +30,7 @@ |
31 | 31 | ] |
32 | 32 | }); |
33 | 33 | |
34 | | -mw.language.grammartest({ |
| 34 | +grammartest({ |
35 | 35 | language: 'he', |
36 | 36 | test: [ |
37 | 37 | { word: "ויקיפדיה", grammarForm: 'prefixed', expected: "וויקיפדיה", description: 'Grammar test for Hebrew, Duplicate the "Waw" if prefixed' }, |
— | — | @@ -41,7 +41,7 @@ |
42 | 42 | ] |
43 | 43 | }); |
44 | 44 | |
45 | | -mw.language.grammartest({ |
| 45 | +grammartest({ |
46 | 46 | language: 'hsb', |
47 | 47 | test: [ |
48 | 48 | { word: 'word', grammarForm: 'instrumental', expected: 'z word', description: 'Grammar test for Upper Sorbian, instrumental case' }, |
— | — | @@ -49,7 +49,7 @@ |
50 | 50 | ] |
51 | 51 | }); |
52 | 52 | |
53 | | -mw.language.grammartest({ |
| 53 | +grammartest({ |
54 | 54 | language: 'dsb', |
55 | 55 | test: [ |
56 | 56 | { word: 'word', grammarForm: 'instrumental', expected: 'z word', description: 'Grammar test for Lower Sorbian, instrumental case' }, |
— | — | @@ -57,7 +57,7 @@ |
58 | 58 | ] |
59 | 59 | }); |
60 | 60 | |
61 | | -mw.language.grammartest({ |
| 61 | +grammartest({ |
62 | 62 | language: 'hy', |
63 | 63 | test: [ |
64 | 64 | { word: 'Մաունա', grammarForm: 'genitive', expected: 'Մաունայի', description: 'Grammar test for Armenian, genitive case' }, |
— | — | @@ -67,7 +67,7 @@ |
68 | 68 | ] |
69 | 69 | }); |
70 | 70 | |
71 | | -mw.language.grammartest({ |
| 71 | +grammartest({ |
72 | 72 | language: 'fi', |
73 | 73 | test: [ |
74 | 74 | { word: 'talo', grammarForm: 'genitive', expected: 'talon', description: 'Grammar test for Finnish, genitive case' }, |
— | — | @@ -80,7 +80,7 @@ |
81 | 81 | ] |
82 | 82 | }); |
83 | 83 | |
84 | | -mw.language.grammartest({ |
| 84 | +grammartest({ |
85 | 85 | language: 'ru', |
86 | 86 | test: [ |
87 | 87 | { word: 'тесть', grammarForm: 'genitive', expected: 'тестя', description: 'Grammar test for Russian, genitive case' }, |
— | — | @@ -92,7 +92,7 @@ |
93 | 93 | ] |
94 | 94 | }); |
95 | 95 | |
96 | | -mw.language.grammartest({ |
| 96 | +grammartest({ |
97 | 97 | language: 'hu', |
98 | 98 | test: [ |
99 | 99 | { word: 'Wikipédiá', grammarForm: 'rol', expected: 'Wikipédiáról', description: 'Grammar test for Hungarian, rol case' }, |
— | — | @@ -101,7 +101,7 @@ |
102 | 102 | ] |
103 | 103 | }); |
104 | 104 | |
105 | | -mw.language.grammartest({ |
| 105 | +grammartest({ |
106 | 106 | language: 'ga', |
107 | 107 | test: [ |
108 | 108 | { word: 'an Domhnach', grammarForm: 'ainmlae', expected: 'Dé Domhnaigh', description: 'Grammar test for Irish, ainmlae case' }, |
— | — | @@ -110,7 +110,7 @@ |
111 | 111 | ] |
112 | 112 | }); |
113 | 113 | |
114 | | -mw.language.grammartest({ |
| 114 | +grammartest({ |
115 | 115 | language: 'uk', |
116 | 116 | test: [ |
117 | 117 | { word: 'тесть', grammarForm: 'genitive', expected: 'тестя', description: 'Grammar test for Ukrainian, genitive case' }, |
— | — | @@ -124,7 +124,7 @@ |
125 | 125 | }); |
126 | 126 | |
127 | 127 | |
128 | | -mw.language.grammartest({ |
| 128 | +grammartest({ |
129 | 129 | language: 'sl', |
130 | 130 | test: [ |
131 | 131 | { word: 'word', grammarForm: 'orodnik', expected: 'z word', description: 'Grammar test for Slovenian, orodnik case' }, |
— | — | @@ -132,7 +132,7 @@ |
133 | 133 | ] |
134 | 134 | }); |
135 | 135 | |
136 | | -mw.language.grammartest({ |
| 136 | +grammartest({ |
137 | 137 | language: 'os', |
138 | 138 | test: [ |
139 | 139 | { word: 'бæстæ', grammarForm: 'genitive', expected: 'бæсты', description: 'Grammar test for Ossetian, genitive case' }, |
— | — | @@ -144,7 +144,7 @@ |
145 | 145 | ] |
146 | 146 | }); |
147 | 147 | |
148 | | -mw.language.grammartest({ |
| 148 | +grammartest({ |
149 | 149 | language: 'la', |
150 | 150 | test: [ |
151 | 151 | { word: 'Translatio', grammarForm: 'genitive', expected: 'Translationis', description: 'Grammar test for Latin, genitive case' }, |