r91149 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91148‎ | r91149 | r91150 >
Date:01:20, 30 June 2011
Author:krinkle
Status:ok
Tags:
Comment:
Adding alternative method for U+024B62. Making sure both ways work.
Modified paths:
  • /trunk/phase3/tests/qunit/suites/resources/jquery/jquery.byteLength.js (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/qunit/suites/resources/jquery/jquery.byteLength.js
@@ -23,16 +23,20 @@
2424 } );
2525
2626 test( 'Special text', window.foo = function() {
27 - expect(4);
 27+ expect(5);
2828
2929 // http://en.wikipedia.org/wiki/UTF-8
3030 var U_0024 = '\u0024',
3131 U_00A2 = '\u00A2',
3232 U_20AC = '\u20AC',
33 - U_024B62 = '\u024B62';
 33+ U_024B62 = '\u024B62',
 34+ // The normal one doesn't display properly, try the below which is the same
 35+ // according to http://www.fileformat.info/info/unicode/char/24B62/index.htm
 36+ U_024B62_alt = '\uD852\uDF62';
3437
35 - strictEqual( $.byteLength( U_0024 ), 1, 'U+0024: 1 byte (dollar sign) $' );
36 - strictEqual( $.byteLength( U_00A2 ), 2, 'U+00A2: 2 bytes (cent sign) ¢' );
37 - strictEqual( $.byteLength( U_20AC ), 3, 'U+20AC: 3 bytes (euro sign) €' );
38 - strictEqual( $.byteLength( U_024B62 ), 4, 'U+024B62: 4 bytes 𤭢 \U00024B62 ' );
 38+ strictEqual( $.byteLength( U_0024 ), 1, 'U+0024: 1 byte. \u0024 (dollar sign)' );
 39+ strictEqual( $.byteLength( U_00A2 ), 2, 'U+00A2: 2 bytes. \u00A2 (cent sign)' );
 40+ strictEqual( $.byteLength( U_20AC ), 3, 'U+20AC: 3 bytes. \u20AC (euro sign)' );
 41+ strictEqual( $.byteLength( U_024B62 ), 4, 'U+024B62: 4 bytes. \uD852\uDF62 (a Han character)' );
 42+ strictEqual( $.byteLength( U_024B62_alt ), 4, 'U+024B62: 4 bytes. \uD852\uDF62 (a Han character) - alternative method' );
3943 } );

Status & tagging log