diff options
author | Norbert Lindenberg <ecmascript@lindenbergsoftware.com> | 2012-08-26 20:50:24 -0700 |
---|---|---|
committer | Norbert Lindenberg <ecmascript@lindenbergsoftware.com> | 2012-08-26 20:50:24 -0700 |
commit | 2f88b751bd6eb49bc2ca985e89aea86deb67a1de (patch) | |
tree | 79aed459cf2d8f9d26f8e0ece825d5e20b1d4650 /test/suite/intl402/ch10/10.3/10.3.2_CS_a.js | |
parent | 02764dfe42d9b70f574fcad9db5210a0336d6d8f (diff) | |
download | test262-2f88b751bd6eb49bc2ca985e89aea86deb67a1de.tar.gz |
Added new tests for chapters 10 to 13 of the ECMAScript Internationalization API Specification.
--HG--
rename : test/suite/intl402/ch10/10.3/10.3.js => test/suite/intl402/ch10/10.3/10.3_a.js
rename : test/suite/intl402/ch11/11.3/11.3.js => test/suite/intl402/ch11/11.3/11.3_a.js
rename : test/suite/intl402/ch12/12.3/12.3.js => test/suite/intl402/ch12/12.3/12.3_a.js
Diffstat (limited to 'test/suite/intl402/ch10/10.3/10.3.2_CS_a.js')
-rw-r--r-- | test/suite/intl402/ch10/10.3/10.3.2_CS_a.js | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/test/suite/intl402/ch10/10.3/10.3.2_CS_a.js b/test/suite/intl402/ch10/10.3/10.3.2_CS_a.js new file mode 100644 index 000000000..88e3cdb87 --- /dev/null +++ b/test/suite/intl402/ch10/10.3/10.3.2_CS_a.js @@ -0,0 +1,56 @@ +// Copyright 2012 Norbert Lindenberg. All rights reserved. +// Copyright 2012 Mozilla Corporation. All rights reserved. +// This code is governed by the license found in the LICENSE file. + +/** + * @description Tests that the function returned by Intl.Collator.prototype.compare + * returns 0 when comparing Strings that are considered canonically equivalent + * by the Unicode standard. + * @author Norbert Lindenberg + */ + +var collator = new Intl.Collator(); +var pairs = [ + // example from Unicode 5.0, section 3.7, definition D70 + ["o\u0308", "ö"], + // examples from Unicode 5.0, chapter 3.11 + ["ä\u0323", "a\u0323\u0308"], + ["a\u0308\u0323", "a\u0323\u0308"], + ["ạ\u0308", "a\u0323\u0308"], + ["ä\u0306", "a\u0308\u0306"], + ["ă\u0308", "a\u0306\u0308"], + // example from Unicode 5.0, chapter 3.12 + ["\u1111\u1171\u11B6", "퓛"], + // examples from UTS 10, Unicode Collation Algorithm + ["Å", "Å"], + ["Å", "A\u030A"], + ["x\u031B\u0323", "x\u0323\u031B"], + ["ự", "ụ\u031B"], + ["ự", "u\u031B\u0323"], + ["ự", "ư\u0323"], + ["ự", "u\u0323\u031B"], + // examples from UAX 15, Unicode Normalization Forms + ["Ç", "C\u0327"], + ["q\u0307\u0323", "q\u0323\u0307"], + ["가", "\u1100\u1161"], + ["Å", "A\u030A"], + ["Ω", "Ω"], + ["Å", "A\u030A"], + ["ô", "o\u0302"], + ["ṩ", "s\u0323\u0307"], + ["ḋ\u0323", "d\u0323\u0307"], + ["ḋ\u0323", "ḍ\u0307"], + ["q\u0307\u0323", "q\u0323\u0307"], + // examples involving supplementary characters from UCD NormalizationTest.txt + ["\uD834\uDD5E", "\uD834\uDD57\uD834\uDD65"], + ["\uD87E\uDC2B", "北"] + +]; +var i; +for (i = 0; i < pairs.length; i++) { + var pair = pairs[i]; + if (collator.compare(pair[0], pair[1]) !== 0) { + $ERROR("Collator.compare considers " + pair[0] + " ≠ " + pair[1] + "."); + } +} + |