| OLD | NEW |
| (Empty) |
| 1 description( | |
| 2 | |
| 3 "This test checks that toLowerCase and toUpperCase handle certain non-trivial ca
ses correctly." | |
| 4 | |
| 5 ); | |
| 6 | |
| 7 shouldBe('String("A𐐀").toLowerCase()', '"a𐐨"'); | |
| 8 shouldBe('String("a𐐨").toUpperCase()', '"A𐐀"'); | |
| 9 shouldBe('String("ΚΟΣΜΟΣ ΚΟΣΜΟΣ").toLowerCase()', '"κοσμος κοσμος"'); | |
| 10 shouldBe('String("ß").toUpperCase()', '"SS"'); | |
| 11 shouldBe('String("ʼn").toUpperCase()', '"ʼN"'); | |
| 12 shouldBe('String("ǰ").toUpperCase()', '"J̌"'); | |
| 13 shouldBe('String("ffi").toUpperCase()', '"FFI"'); | |
| 14 shouldBe('String("FFI").toLowerCase()', '"ffi"'); | |
| 15 shouldBe('String("IJ").toLowerCase()', '"ij"'); | |
| 16 | |
| 17 // Test the toUpper and toLower changes made in Unicode versions 5.2 and 6.1 | |
| 18 // Construct the tests so that it passes if the toLowerCase()/toUpperCase() | |
| 19 // either return the updated results for compliant platforms or the | |
| 20 // passed in arguments if not. This should be changed when all platforms | |
| 21 // support Unicode 5.2 and Unicode 6.1. | |
| 22 function createExpected(/* ... */) | |
| 23 { | |
| 24 expected = {}; | |
| 25 | |
| 26 for (var i = 0; i < arguments.length; i++) { | |
| 27 var s = String.fromCharCode(arguments[i]); | |
| 28 expected[s] = true; | |
| 29 } | |
| 30 | |
| 31 return expected; | |
| 32 } | |
| 33 | |
| 34 // Check Unicode additions in version 5.2. From UnicodeData.txt: | |
| 35 // 0265;LATIN SMALL LETTER TURNED H;Ll;0;L;;;;;N;;;A78D;;A78D | |
| 36 // A78D;LATIN CAPITAL LETTER TURNED H;Lu;0;L;;;;;N;;;;0265; | |
| 37 | |
| 38 var expected = createExpected(0xA78D, 0x0265); | |
| 39 shouldBeTrue('expected[String.fromCharCode(0xA78D).toLowerCase()]'); | |
| 40 shouldBeTrue('expected[String.fromCharCode(0x0265).toUpperCase()]'); | |
| 41 | |
| 42 // Check Unicode additions in version 6.1 From UnicodeData.txt: | |
| 43 // 0266;LATIN SMALL LETTER H WITH HOOK;Ll;0;L;;;;;N;LATIN SMALL LETTER H HOOK;;A
7AA;;A7AA | |
| 44 // 10C7;GEORGIAN CAPITAL LETTER YN;Lu;0;L;;;;;N;;;;2D27; | |
| 45 // 10CD;GEORGIAN CAPITAL LETTER AEN;Lu;0;L;;;;;N;;;;2D2D; | |
| 46 // 2CF2;COPTIC CAPITAL LETTER BOHAIRIC KHEI;Lu;0;L;;;;;N;;;;2CF3; | |
| 47 // 2CF3;COPTIC SMALL LETTER BOHAIRIC KHEI;Ll;0;L;;;;;N;;;2CF2;;2CF2 | |
| 48 // 2D27;GEORGIAN SMALL LETTER YN;Ll;0;L;;;;;N;;;10C7;;10C7 | |
| 49 // 2D2D;GEORGIAN SMALL LETTER AEN;Ll;0;L;;;;;N;;;10CD;;10CD | |
| 50 // A792;LATIN CAPITAL LETTER C WITH BAR;Lu;0;L;;;;;N;;;;A793; | |
| 51 // A793;LATIN SMALL LETTER C WITH BAR;Ll;0;L;;;;;N;;;A792;;A792 | |
| 52 // A7AA;LATIN CAPITAL LETTER H WITH HOOK;Lu;0;L;;;;;N;;;;0266; | |
| 53 | |
| 54 var expected = createExpected(0x10C7, 0x2D27); | |
| 55 shouldBeTrue('expected[String.fromCharCode(0x10C7).toLowerCase()]'); | |
| 56 shouldBeTrue('expected[String.fromCharCode(0x2D27).toUpperCase()]'); | |
| 57 | |
| 58 var expected = createExpected(0x10CD, 0x2D2D); | |
| 59 shouldBeTrue('expected[String.fromCharCode(0x2D2D).toLowerCase()]'); | |
| 60 shouldBeTrue('expected[String.fromCharCode(0x10CD).toUpperCase()]'); | |
| 61 | |
| 62 var expected = createExpected(0x2CF2, 0x2CF3); | |
| 63 shouldBeTrue('expected[String.fromCharCode(0x2CF2).toLowerCase()]'); | |
| 64 shouldBeTrue('expected[String.fromCharCode(0x2CF3).toUpperCase()]'); | |
| 65 | |
| 66 var expected = createExpected(0xA792, 0xA793); | |
| 67 shouldBeTrue('expected[String.fromCharCode(0xA792).toLowerCase()]'); | |
| 68 shouldBeTrue('expected[String.fromCharCode(0xA793).toUpperCase()]'); | |
| 69 | |
| 70 var expected = createExpected(0xA7AA, 0x0266); | |
| 71 shouldBeTrue('expected[String.fromCharCode(0xA7AA).toLowerCase()]'); | |
| 72 shouldBeTrue('expected[String.fromCharCode(0x0266).toUpperCase()]'); | |
| OLD | NEW |