Index: trunk/phase3/resources/test/unit/jquery/jquery.colorUtil.js |
— | — | @@ -7,27 +7,27 @@ |
8 | 8 | |
9 | 9 | test( 'getRGB', function(){ |
10 | 10 | |
11 | | - equals( typeof jQuery.colorUtil.getRGB(), 'undefined', 'No arguments' ); |
12 | | - equals( typeof jQuery.colorUtil.getRGB( '' ), 'undefined', 'Empty string' ); |
13 | | - same( jQuery.colorUtil.getRGB( [0, 100, 255] ), [0, 100, 255], 'Array' ); |
14 | | - same( jQuery.colorUtil.getRGB( 'rgb(0,100,255)' ), [0, 100, 255], 'Parse simple string' ); |
15 | | - same( jQuery.colorUtil.getRGB( 'rgb(0, 100, 255)' ), [0, 100, 255], 'Parse simple string (whitespace)' ); |
16 | | - same( jQuery.colorUtil.getRGB( 'rgb(0%,20%,40%)' ), [0, 51, 102], 'Parse percentages string' ); |
17 | | - same( jQuery.colorUtil.getRGB( 'rgb(0%, 20%, 40%)' ), [0, 51, 102], 'Parse percentages string (whitespace)' ); |
18 | | - same( jQuery.colorUtil.getRGB( '#f2ddee' ), [242, 221, 238], 'Hex string: 6 char lowercase' ); |
19 | | - same( jQuery.colorUtil.getRGB( '#f2DDEE' ), [242, 221, 238], 'Hex string: 6 char uppercase' ); |
20 | | - same( jQuery.colorUtil.getRGB( '#f2DdEe' ), [242, 221, 238], 'Hex string: 6 char mixed' ); |
21 | | - same( jQuery.colorUtil.getRGB( '#eee' ), [238, 238, 238], 'Hex string: 3 char lowercase' ); |
22 | | - same( jQuery.colorUtil.getRGB( '#EEE' ), [238, 238, 238], 'Hex string: 3 char uppercase' ); |
23 | | - same( jQuery.colorUtil.getRGB( '#eEe' ), [238, 238, 238], 'Hex string: 3 char mixed' ); |
24 | | - same( jQuery.colorUtil.getRGB( 'rgba(0, 0, 0, 0)' ), [255, 255, 255], 'Zero rgba for Safari 3; Transparent (whitespace)' ); |
| 11 | + equal( typeof jQuery.colorUtil.getRGB(), 'undefined', 'No arguments' ); |
| 12 | + equal( typeof jQuery.colorUtil.getRGB( '' ), 'undefined', 'Empty string' ); |
| 13 | + deepEqual( jQuery.colorUtil.getRGB( [0, 100, 255] ), [0, 100, 255], 'Array' ); |
| 14 | + deepEqual( jQuery.colorUtil.getRGB( 'rgb(0,100,255)' ), [0, 100, 255], 'Parse simple string' ); |
| 15 | + deepEqual( jQuery.colorUtil.getRGB( 'rgb(0, 100, 255)' ), [0, 100, 255], 'Parse simple string (whitespace)' ); |
| 16 | + deepEqual( jQuery.colorUtil.getRGB( 'rgb(0%,20%,40%)' ), [0, 51, 102], 'Parse percentages string' ); |
| 17 | + deepEqual( jQuery.colorUtil.getRGB( 'rgb(0%, 20%, 40%)' ), [0, 51, 102], 'Parse percentages string (whitespace)' ); |
| 18 | + deepEqual( jQuery.colorUtil.getRGB( '#f2ddee' ), [242, 221, 238], 'Hex string: 6 char lowercase' ); |
| 19 | + deepEqual( jQuery.colorUtil.getRGB( '#f2DDEE' ), [242, 221, 238], 'Hex string: 6 char uppercase' ); |
| 20 | + deepEqual( jQuery.colorUtil.getRGB( '#f2DdEe' ), [242, 221, 238], 'Hex string: 6 char mixed' ); |
| 21 | + deepEqual( jQuery.colorUtil.getRGB( '#eee' ), [238, 238, 238], 'Hex string: 3 char lowercase' ); |
| 22 | + deepEqual( jQuery.colorUtil.getRGB( '#EEE' ), [238, 238, 238], 'Hex string: 3 char uppercase' ); |
| 23 | + deepEqual( jQuery.colorUtil.getRGB( '#eEe' ), [238, 238, 238], 'Hex string: 3 char mixed' ); |
| 24 | + deepEqual( jQuery.colorUtil.getRGB( 'rgba(0, 0, 0, 0)' ), [255, 255, 255], 'Zero rgba for Safari 3; Transparent (whitespace)' ); |
25 | 25 | // Perhaps this is a bug in colorUtil, but it is the current behaviour so, let's keep track |
26 | 26 | // would that ever chnge |
27 | | - equals( typeof jQuery.colorUtil.getRGB( 'rgba(0,0,0,0)' ), 'undefined', 'Zero rgba without whitespace' ); |
| 27 | + equal( typeof jQuery.colorUtil.getRGB( 'rgba(0,0,0,0)' ), 'undefined', 'Zero rgba without whitespace' ); |
28 | 28 | |
29 | | - same( jQuery.colorUtil.getRGB( 'lightGreen' ), [144, 238, 144], 'Color names (lightGreen)' ); |
30 | | - same( jQuery.colorUtil.getRGB( 'lightGreen' ), [144, 238, 144], 'Color names (transparent)' ); |
31 | | - equals( typeof jQuery.colorUtil.getRGB( 'mediaWiki' ), 'undefined', 'Inexisting Color name' ); |
| 29 | + deepEqual( jQuery.colorUtil.getRGB( 'lightGreen' ), [144, 238, 144], 'Color names (lightGreen)' ); |
| 30 | + deepEqual( jQuery.colorUtil.getRGB( 'lightGreen' ), [144, 238, 144], 'Color names (transparent)' ); |
| 31 | + equal( typeof jQuery.colorUtil.getRGB( 'mediaWiki' ), 'undefined', 'Inexisting Color name' ); |
32 | 32 | |
33 | 33 | }); |
34 | 34 | |
— | — | @@ -38,9 +38,9 @@ |
39 | 39 | }; |
40 | 40 | |
41 | 41 | ok( hsl, 'Basic return evaluation' ); |
42 | | - same( dualDecimals(hsl[0]) , 0.33, 'rgb(144, 238, 144): H 0.33' ); |
43 | | - same( dualDecimals(hsl[1]) , 0.73, 'rgb(144, 238, 144): S 0.73' ); |
44 | | - same( dualDecimals(hsl[2]) , 0.75, 'rgb(144, 238, 144): L 0.75' ); |
| 42 | + deepEqual( dualDecimals(hsl[0]) , 0.33, 'rgb(144, 238, 144): H 0.33' ); |
| 43 | + deepEqual( dualDecimals(hsl[1]) , 0.73, 'rgb(144, 238, 144): S 0.73' ); |
| 44 | + deepEqual( dualDecimals(hsl[2]) , 0.75, 'rgb(144, 238, 144): L 0.75' ); |
45 | 45 | |
46 | 46 | }); |
47 | 47 | |
— | — | @@ -48,9 +48,9 @@ |
49 | 49 | var rgb = jQuery.colorUtil.hslToRgb( 0.3, 0.7, 0.8 ); |
50 | 50 | |
51 | 51 | ok( rgb, 'Basic return evaluation' ); |
52 | | - same( Math.round(rgb[0]) , 183, 'hsl(0.3, 0.7, 0.8): R 183' ); |
53 | | - same( Math.round(rgb[1]) , 240, 'hsl(0.3, 0.7, 0.8): G 240' ); |
54 | | - same( Math.round(rgb[2]) , 168, 'hsl(0.3, 0.7, 0.8): B 168' ); |
| 52 | + deepEqual( Math.round(rgb[0]) , 183, 'hsl(0.3, 0.7, 0.8): R 183' ); |
| 53 | + deepEqual( Math.round(rgb[1]) , 240, 'hsl(0.3, 0.7, 0.8): G 240' ); |
| 54 | + deepEqual( Math.round(rgb[2]) , 168, 'hsl(0.3, 0.7, 0.8): B 168' ); |
55 | 55 | |
56 | 56 | }); |
57 | 57 | |
— | — | @@ -58,10 +58,10 @@ |
59 | 59 | |
60 | 60 | var a = jQuery.colorUtil.getColorBrightness( 'red', +0.1 ); |
61 | 61 | |
62 | | - equals( a, 'rgb(255,50,50)', 'Start with named color, brighten 10%' ); |
| 62 | + equal( a, 'rgb(255,50,50)', 'Start with named color, brighten 10%' ); |
63 | 63 | |
64 | 64 | var b = jQuery.colorUtil.getColorBrightness( 'rgb(200,50,50)', -0.2 ); |
65 | 65 | |
66 | | - equals( b, 'rgb(118,29,29)', 'Start with rgb string, darken 10%' ); |
| 66 | + equal( b, 'rgb(118,29,29)', 'Start with rgb string, darken 10%' ); |
67 | 67 | |
68 | 68 | }); |
Index: trunk/phase3/resources/test/unit/mediawiki.util/mediawiki.util.js |
— | — | @@ -8,13 +8,13 @@ |
9 | 9 | |
10 | 10 | test( 'rawurlencode', function(){ |
11 | 11 | |
12 | | - equals( mw.util.rawurlencode( 'Test:A & B/Here' ), 'Test%3AA%20%26%20B%2FHere' ); |
| 12 | + equal( mw.util.rawurlencode( 'Test:A & B/Here' ), 'Test%3AA%20%26%20B%2FHere' ); |
13 | 13 | |
14 | 14 | }); |
15 | 15 | |
16 | 16 | test( 'wikiUrlencode', function(){ |
17 | 17 | |
18 | | - equals( mw.util.wikiUrlencode( 'Test:A & B/Here' ), 'Test:A_%26_B/Here' ); |
| 18 | + equal( mw.util.wikiUrlencode( 'Test:A & B/Here' ), 'Test:A_%26_B/Here' ); |
19 | 19 | |
20 | 20 | }); |
21 | 21 | |
— | — | @@ -22,10 +22,10 @@ |
23 | 23 | |
24 | 24 | var a = mw.util.addCSS( '#bodyContent { visibility: hidden; }' ); |
25 | 25 | ok( a, 'function works' ); |
26 | | - same( a.disabled, false, 'property "disabled" is available and set to false' ); |
| 26 | + deepEqual( a.disabled, false, 'property "disabled" is available and set to false' ); |
27 | 27 | |
28 | 28 | var $b = $('#bodyContent'); |
29 | | - equals( $b.css('visibility'), 'hidden', 'Added style properties are in effect.' ); |
| 29 | + equal( $b.css('visibility'), 'hidden', 'Added style properties are in effect.' ); |
30 | 30 | |
31 | 31 | |
32 | 32 | }); |
— | — | @@ -43,11 +43,11 @@ |
44 | 44 | |
45 | 45 | var hrefA = mw.util.wikiGetlink( 'Sandbox' ); |
46 | 46 | |
47 | | - equals( hrefA, '/wiki/Sandbox', 'Simple title; Get link for "Sandbox"' ); |
| 47 | + equal( hrefA, '/wiki/Sandbox', 'Simple title; Get link for "Sandbox"' ); |
48 | 48 | |
49 | 49 | var hrefB = mw.util.wikiGetlink( 'Foo:Sandbox ? 5+5=10 ! (test)/subpage' ); |
50 | 50 | |
51 | | - equals( hrefB, '/wiki/Foo:Sandbox_%3F_5%2B5%3D10_%21_%28test%29/subpage', 'Advanced title; Get link for "Foo:Sandbox ? 5+5=10 ! (test)/subpage"' ); |
| 51 | + equal( hrefB, '/wiki/Foo:Sandbox_%3F_5%2B5%3D10_%21_%28test%29/subpage', 'Advanced title; Get link for "Foo:Sandbox ? 5+5=10 ! (test)/subpage"' ); |
52 | 52 | |
53 | 53 | }); |
54 | 54 | |
— | — | @@ -131,7 +131,7 @@ |
132 | 132 | |
133 | 133 | test( 'tooltipAccessKey', function(){ |
134 | 134 | |
135 | | - equals( typeof mw.util.tooltipAccessKeyPrefix, 'string', 'mw.util.tooltipAccessKeyPrefix must be a string' ); |
| 135 | + equal( typeof mw.util.tooltipAccessKeyPrefix, 'string', 'mw.util.tooltipAccessKeyPrefix must be a string' ); |
136 | 136 | ok( mw.util.tooltipAccessKeyRegexp instanceof RegExp, 'mw.util.tooltipAccessKeyRegexp instance of RegExp' ); |
137 | 137 | ok( mw.util.updateTooltipAccessKeys, 'mw.util.updateTooltipAccessKeys' ); |
138 | 138 | |
— | — | @@ -140,7 +140,7 @@ |
141 | 141 | test( '$content', function(){ |
142 | 142 | |
143 | 143 | ok( mw.util.$content instanceof jQuery, 'mw.util.$content instance of jQuery' ); |
144 | | - same( mw.util.$content.length, 1, 'mw.util.$content must have length of 1' ); |
| 144 | + deepEqual( mw.util.$content.length, 1, 'mw.util.$content must have length of 1' ); |
145 | 145 | |
146 | 146 | }); |
147 | 147 | |
— | — | @@ -152,8 +152,8 @@ |
153 | 153 | |
154 | 154 | var b = mw.util.addPortletLink( "p-tb", "http://mediawiki.org/", "MediaWiki.org", "t-mworg", "Go to MediaWiki.org ", "m", "#t-rl" ); |
155 | 155 | |
156 | | - equals( $(a).text(), 'ResourceLoader', 'Link contains correct text' ); |
157 | | - equals( $(b).next().text(), 'ResourceLoader', 'Link was inserted in correct nextnode position' ); |
| 156 | + equal( $(a).text(), 'ResourceLoader', 'Link contains correct text' ); |
| 157 | + equal( $(b).next().text(), 'ResourceLoader', 'Link was inserted in correct nextnode position' ); |
158 | 158 | |
159 | 159 | }); |
160 | 160 | |
— | — | @@ -167,36 +167,36 @@ |
168 | 168 | |
169 | 169 | test( 'validateEmail', function(){ |
170 | 170 | |
171 | | - same( mw.util.validateEmail( "" ), null, 'Empty string should return null' ); |
172 | | - same( mw.util.validateEmail( "user@localhost" ), true ); |
| 171 | + deepEqual( mw.util.validateEmail( "" ), null, 'Empty string should return null' ); |
| 172 | + deepEqual( mw.util.validateEmail( "user@localhost" ), true ); |
173 | 173 | |
174 | 174 | // testEmailWithCommasAreInvalids |
175 | | - same( mw.util.validateEmail( "user,foo@example.org" ), false, 'Comma' ); |
176 | | - same( mw.util.validateEmail( "userfoo@ex,ample.org" ), false, 'Comma' ); |
| 175 | + deepEqual( mw.util.validateEmail( "user,foo@example.org" ), false, 'Comma' ); |
| 176 | + deepEqual( mw.util.validateEmail( "userfoo@ex,ample.org" ), false, 'Comma' ); |
177 | 177 | |
178 | 178 | // testEmailWithHyphens |
179 | | - same( mw.util.validateEmail( "user-foo@example.org" ), true, 'Hyphen' ); |
180 | | - same( mw.util.validateEmail( "userfoo@ex-ample.org" ), true, 'Hyphen' ); |
| 179 | + deepEqual( mw.util.validateEmail( "user-foo@example.org" ), true, 'Hyphen' ); |
| 180 | + deepEqual( mw.util.validateEmail( "userfoo@ex-ample.org" ), true, 'Hyphen' ); |
181 | 181 | |
182 | 182 | }); |
183 | 183 | |
184 | 184 | test( 'isIPv6Address', function(){ |
185 | 185 | |
186 | 186 | // Based on IPTest.php > IPv6 |
187 | | - same( mw.util.isIPv6Address( "" ), false, 'Empty string is not an IP' ); |
188 | | - same( mw.util.isIPv6Address( ":fc:100::" ), false, 'IPv6 starting with lone ":"' ); |
189 | | - same( mw.util.isIPv6Address( "fc:100::" ), true ); |
190 | | - same( mw.util.isIPv6Address( "fc:100:a:d:1:e:ac::" ), true ); |
191 | | - same( mw.util.isIPv6Address( ":::" ), false ); |
192 | | - same( mw.util.isIPv6Address( "::0:" ), false ); |
| 187 | + deepEqual( mw.util.isIPv6Address( "" ), false, 'Empty string is not an IP' ); |
| 188 | + deepEqual( mw.util.isIPv6Address( ":fc:100::" ), false, 'IPv6 starting with lone ":"' ); |
| 189 | + deepEqual( mw.util.isIPv6Address( "fc:100::" ), true ); |
| 190 | + deepEqual( mw.util.isIPv6Address( "fc:100:a:d:1:e:ac::" ), true ); |
| 191 | + deepEqual( mw.util.isIPv6Address( ":::" ), false ); |
| 192 | + deepEqual( mw.util.isIPv6Address( "::0:" ), false ); |
193 | 193 | |
194 | 194 | }); |
195 | 195 | |
196 | 196 | test( 'isIPv4Address', function(){ |
197 | 197 | |
198 | 198 | // Based on IPTest.php > IPv4 |
199 | | - same( mw.util.isIPv4Address( "" ), false, 'Empty string is not an IP' ); |
200 | | - same( mw.util.isIPv4Address( "...." ), false ); |
201 | | - same( mw.util.isIPv4Address( "1.24.52.13" ), true ); |
| 199 | + deepEqual( mw.util.isIPv4Address( "" ), false, 'Empty string is not an IP' ); |
| 200 | + deepEqual( mw.util.isIPv4Address( "...." ), false ); |
| 201 | + deepEqual( mw.util.isIPv4Address( "1.24.52.13" ), true ); |
202 | 202 | |
203 | 203 | }); |
Index: trunk/phase3/resources/test/unit/mediawiki/mediawiki.js |
— | — | @@ -4,51 +4,51 @@ |
5 | 5 | |
6 | 6 | ok( window.jQuery, 'jQuery defined' ); |
7 | 7 | ok( window.$j, '$j defined' ); |
8 | | - equals( window.$j, window.jQuery, '$j alias to jQuery' ); |
| 8 | + equal( window.$j, window.jQuery, '$j alias to jQuery' ); |
9 | 9 | |
10 | 10 | ok( window.mediaWiki, 'mediaWiki defined' ); |
11 | 11 | ok( window.mw, 'mw defined' ); |
12 | | - equals( window.mw, window.mediaWiki, 'mw alias to mediaWiki' ); |
| 12 | + equal( window.mw, window.mediaWiki, 'mw alias to mediaWiki' ); |
13 | 13 | |
14 | 14 | }); |
15 | 15 | |
16 | 16 | test( 'jQuery.extend', function(){ |
17 | 17 | |
18 | | - equals( $j.trimLeft( ' foo bar ' ), 'foo bar ', 'trimLeft' ); |
19 | | - equals( $j.trimRight( ' foo bar ' ), ' foo bar', 'trimRight' ); |
20 | | - equals( $j.ucFirst( 'foo'), 'Foo', 'ucFirst' ); |
| 18 | + equal( $j.trimLeft( ' foo bar ' ), 'foo bar ', 'trimLeft' ); |
| 19 | + equal( $j.trimRight( ' foo bar ' ), ' foo bar', 'trimRight' ); |
| 20 | + equal( $j.ucFirst( 'foo'), 'Foo', 'ucFirst' ); |
21 | 21 | |
22 | | - equals( $j.escapeRE( '<!-- ([{+mW+}]) $^|?>' ), |
| 22 | + equal( $j.escapeRE( '<!-- ([{+mW+}]) $^|?>' ), |
23 | 23 | '<!\\-\\- \\(\\[\\{\\+mW\\+\\}\\]\\) \\$\\^\\|\\?>', 'escapeRE - Escape specials' ); |
24 | | - equals( $j.escapeRE( 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' ), |
| 24 | + equal( $j.escapeRE( 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' ), |
25 | 25 | 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'escapeRE - Leave uppercase alone' ); |
26 | | - equals( $j.escapeRE( 'abcdefghijklmnopqrstuvwxyz' ), |
| 26 | + equal( $j.escapeRE( 'abcdefghijklmnopqrstuvwxyz' ), |
27 | 27 | 'abcdefghijklmnopqrstuvwxyz', 'escapeRE - Leave lowercase alone' ); |
28 | | - equals( $j.escapeRE( '0123456789' ), '0123456789', 'escapeRE - Leave numbers alone' ); |
| 28 | + equal( $j.escapeRE( '0123456789' ), '0123456789', 'escapeRE - Leave numbers alone' ); |
29 | 29 | |
30 | | - same( $j.isDomElement( document.getElementById( 'qunit-header' ) ), true, |
| 30 | + deepEqual( $j.isDomElement( document.getElementById( 'qunit-header' ) ), true, |
31 | 31 | 'isDomElement: #qunit-header Node' ); |
32 | | - same( $j.isDomElement( document.getElementById( 'random-name' ) ), false, |
| 32 | + deepEqual( $j.isDomElement( document.getElementById( 'random-name' ) ), false, |
33 | 33 | 'isDomElement: #random-name (null)' ); |
34 | | - same( $j.isDomElement( document.getElementsByTagName( 'div' ) ), false, |
| 34 | + deepEqual( $j.isDomElement( document.getElementsByTagName( 'div' ) ), false, |
35 | 35 | 'isDomElement: getElementsByTagName Array' ); |
36 | | - same( $j.isDomElement( document.getElementsByTagName( 'div' )[0] ), true, |
| 36 | + deepEqual( $j.isDomElement( document.getElementsByTagName( 'div' )[0] ), true, |
37 | 37 | 'isDomElement: getElementsByTagName(..)[0] Node' ); |
38 | | - same( $j.isDomElement( $j( 'div' ) ), false, |
| 38 | + deepEqual( $j.isDomElement( $j( 'div' ) ), false, |
39 | 39 | 'isDomElement: jQuery object' ); |
40 | | - same( $j.isDomElement( $j( 'div' ).get(0) ), true, |
| 40 | + deepEqual( $j.isDomElement( $j( 'div' ).get(0) ), true, |
41 | 41 | 'isDomElement: jQuery object > Get node' ); |
42 | | - same( $j.isDomElement( document.createElement( 'div' ) ), true, |
| 42 | + deepEqual( $j.isDomElement( document.createElement( 'div' ) ), true, |
43 | 43 | 'isDomElement: createElement' ); |
44 | | - same( $j.isDomElement( { foo: 1 } ), false, |
| 44 | + deepEqual( $j.isDomElement( { foo: 1 } ), false, |
45 | 45 | 'isDomElement: Object' ); |
46 | 46 | |
47 | | - equals( $j.isEmpty( 'string' ), false, 'isEmptry: "string"' ); |
48 | | - equals( $j.isEmpty( '0' ), true, 'isEmptry: "0"' ); |
49 | | - equals( $j.isEmpty( [] ), true, 'isEmptry: []' ); |
50 | | - equals( $j.isEmpty( {} ), true, 'isEmptry: {}' ); |
| 47 | + equal( $j.isEmpty( 'string' ), false, 'isEmptry: "string"' ); |
| 48 | + equal( $j.isEmpty( '0' ), true, 'isEmptry: "0"' ); |
| 49 | + equal( $j.isEmpty( [] ), true, 'isEmptry: []' ); |
| 50 | + equal( $j.isEmpty( {} ), true, 'isEmptry: {}' ); |
51 | 51 | // Documented behaviour |
52 | | - equals( $j.isEmpty( { length: 0 } ), true, 'isEmptry: { length: 0 }' ); |
| 52 | + equal( $j.isEmpty( { length: 0 } ), true, 'isEmptry: { length: 0 }' ); |
53 | 53 | |
54 | 54 | ok( $j.compareArray( [0, 'a', [], [2, 'b'] ], [0, "a", [], [2, "b"] ] ), |
55 | 55 | 'compareArray: Two the same deep arrays' ); |
— | — | @@ -72,8 +72,8 @@ |
73 | 73 | ok( mw.config.set( 'lipsum', 'Lorem ipsum' ), 'set: lipsum' ); |
74 | 74 | ok( mw.config.exists( 'lipsum' ), 'exists: lipsum (existant)' ); |
75 | 75 | |
76 | | - equals( mw.config.get( 'lipsum' ), 'Lorem ipsum', 'get: lipsum' ); |
77 | | - equals( mw.config.get( ['lipsum'] ).lipsum, 'Lorem ipsum', 'get: lipsum (multiple)' ); |
| 76 | + equal( mw.config.get( 'lipsum' ), 'Lorem ipsum', 'get: lipsum' ); |
| 77 | + equal( mw.config.get( ['lipsum'] ).lipsum, 'Lorem ipsum', 'get: lipsum (multiple)' ); |
78 | 78 | |
79 | 79 | }); |
80 | 80 | |
— | — | @@ -87,9 +87,9 @@ |
88 | 88 | var hello = mw.message( 'hello' ); |
89 | 89 | ok( hello, 'hello: Instance of Message' ); |
90 | 90 | |
91 | | - equals( hello.format, 'parse', 'Message property "format" (default value)' ); |
92 | | - equals( hello.key, 'hello', 'Message property "key" (currect key)' ); |
93 | | - same( hello.parameters, [], 'Message property "parameters" (default value)' ); |
| 91 | + equal( hello.format, 'parse', 'Message property "format" (default value)' ); |
| 92 | + equal( hello.key, 'hello', 'Message property "key" (currect key)' ); |
| 93 | + deepEqual( hello.parameters, [], 'Message property "parameters" (default value)' ); |
94 | 94 | |
95 | 95 | |
96 | 96 | ok( hello.params, 'Message prototype "params"'); |
— | — | @@ -99,12 +99,12 @@ |
100 | 100 | ok( hello.escaped, 'Message prototype "escaped"'); |
101 | 101 | ok( hello.exists, 'Message prototype "exists"'); |
102 | 102 | |
103 | | - equals( hello.toString(), 'Hello <b>awesome</b> world', 'Message.toString() test'); |
104 | | - equals( hello.escaped(), 'Hello <b>awesome</b> world', 'Message.escaped() test'); |
105 | | - same( hello.exists(), true, 'Message.exists() test'); |
| 103 | + equal( hello.toString(), 'Hello <b>awesome</b> world', 'Message.toString() test'); |
| 104 | + equal( hello.escaped(), 'Hello <b>awesome</b> world', 'Message.escaped() test'); |
| 105 | + deepEqual( hello.exists(), true, 'Message.exists() test'); |
106 | 106 | |
107 | | - equals( mw.msg( 'random' ), '<random>', 'square brackets around inexistant messages' ); |
108 | | - equals( mw.msg( 'hello' ), 'Hello <b>awesome</b> world', 'get message with default options' ); |
| 107 | + equal( mw.msg( 'random' ), '<random>', 'square brackets around inexistant messages' ); |
| 108 | + equal( mw.msg( 'hello' ), 'Hello <b>awesome</b> world', 'get message with default options' ); |
109 | 109 | |
110 | 110 | // params, toString, parse, plain, escaped, exists |
111 | 111 | }); |
— | — | @@ -119,32 +119,32 @@ |
120 | 120 | mw.loader.implement( 'is.awesome', [location.href.match(/[^#\?]*/)[0] + 'sample/awesome.js'], {}, {} ); |
121 | 121 | mw.loader.using( 'is.awesome', function(){ |
122 | 122 | start(); |
123 | | - same( window.awesome, true, 'Implementing a module, is the callback timed properly ?'); |
| 123 | + deepEqual( window.awesome, true, 'Implementing a module, is the callback timed properly ?'); |
124 | 124 | }, function(){ |
125 | 125 | start(); |
126 | | - same( 'mw.loader.using error callback fired', true, 'Implementing a module, is the callback timed properly ?'); |
| 126 | + deepEqual( 'mw.loader.using error callback fired', true, 'Implementing a module, is the callback timed properly ?'); |
127 | 127 | }); |
128 | 128 | |
129 | 129 | }); |
130 | 130 | |
131 | 131 | test( 'mw.html', function(){ |
132 | 132 | |
133 | | - equals( mw.html.escape( '<mw awesome="awesome" value=\'test\' />' ), |
| 133 | + equal( mw.html.escape( '<mw awesome="awesome" value=\'test\' />' ), |
134 | 134 | '<mw awesome="awesome" value='test' />', 'html.escape()' ); |
135 | 135 | |
136 | | - equals( mw.html.element( 'div' ), '<div/>', 'mw.html.element() DIV (simple)' ); |
| 136 | + equal( mw.html.element( 'div' ), '<div/>', 'mw.html.element() DIV (simple)' ); |
137 | 137 | |
138 | | - equals( mw.html.element( 'div', |
| 138 | + equal( mw.html.element( 'div', |
139 | 139 | { id: 'foobar' } ), |
140 | 140 | '<div id="foobar"/>', |
141 | 141 | 'mw.html.element() DIV (attribs)' ); |
142 | 142 | |
143 | | - equals( mw.html.element( 'div', |
| 143 | + equal( mw.html.element( 'div', |
144 | 144 | null, 'a' ), |
145 | 145 | '<div>a</div>', |
146 | 146 | 'mw.html.element() DIV (content)' ); |
147 | 147 | |
148 | | - equals( mw.html.element( 'a', |
| 148 | + equal( mw.html.element( 'a', |
149 | 149 | { href: 'http://mediawiki.org/w/index.php?title=RL&action=history' }, 'a' ), |
150 | 150 | '<a href="http://mediawiki.org/w/index.php?title=RL&action=history">a</a>', |
151 | 151 | 'mw.html.element() DIV (attribs + content)' ); |