Changeset 286998 in webkit
- Timestamp:
- Dec 13, 2021, 5:38:11 PM (5 years ago)
- Location:
- trunk/JSTests
- Files:
-
- 10 edited
-
ChangeLog (modified) (1 diff)
-
stress/array-toLocaleString.js (modified) (1 diff)
-
stress/date-toLocaleString.js (modified) (2 diffs)
-
stress/intl-canonical-locale-alias-mapping.js (modified) (1 diff)
-
stress/intl-datetimeformat-formatrange-relevant-extensions-ja.js (modified) (1 diff)
-
stress/intl-datetimeformat-formatrangetoparts-relevant-extensions-ja.js (modified) (1 diff)
-
stress/intl-datetimeformat.js (modified) (1 diff)
-
stress/intl-enumeration.js (modified) (1 diff)
-
stress/intl-locale-info.js (modified) (1 diff)
-
stress/intl-locale.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/JSTests/ChangeLog
r286881 r286998 1 2021-12-13 Yusuke Suzuki <ysuzuki@apple.com> 2 3 [JSC] Update Intl tests based on ICU 69~ 4 https://bugs.webkit.org/show_bug.cgi?id=234276 5 6 Reviewed by Mark Lam. 7 8 Rebaseline Intl tests based on ICU 69~'s CLDR update. 9 10 * stress/array-toLocaleString.js: 11 * stress/date-toLocaleString.js: 12 * stress/intl-canonical-locale-alias-mapping.js: 13 (Intl.getCanonicalLocales): 14 * stress/intl-datetimeformat-formatrange-relevant-extensions-ja.js: 15 (vm.icuVersion): 16 * stress/intl-datetimeformat-formatrangetoparts-relevant-extensions-ja.js: 17 * stress/intl-datetimeformat.js: 18 * stress/intl-enumeration.js: 19 * stress/intl-locale-info.js: 20 (shouldBe): 21 * stress/intl-locale.js: 22 1 23 2021-12-10 Yusuke Suzuki <ysuzuki@apple.com> 2 24 -
trunk/JSTests/stress/array-toLocaleString.js
r259909 r286998 39 39 // Test that parameters are passed through properly. 40 40 shouldThrow(() => [ new Date ].toLocaleString('i'), RangeError); 41 shouldBe([ new Date(NaN), new Date(0) ].toLocaleString('zh-Hans-CN-u-nu-hanidec', { timeZone: 'UTC' }), 'Invalid Date,一九七〇/一/一 上午一二:〇〇:〇〇');41 shouldBe([ new Date(NaN), new Date(0) ].toLocaleString('zh-Hans-CN-u-nu-hanidec', { timeZone: 'UTC' }), $vm.icuVersion() >= 69 ? 'Invalid Date,一九七〇/一/一 〇〇:〇〇:〇〇' : 'Invalid Date,一九七〇/一/一 上午一二:〇〇:〇〇'); -
trunk/JSTests/stress/date-toLocaleString.js
r260237 r286998 45 45 // Test that locale parameter is passed through properly. 46 46 shouldThrow(() => new Date().toLocaleString('i'), RangeError); 47 shouldBe(new Date(0).toLocaleString('zh-Hans-CN-u-nu-hanidec', { timeZone: 'UTC' }), '一九七〇/一/一 上午一二:〇〇:〇〇');48 shouldBe(new Date(0).toLocaleString('zh-Hans-CN', { timeZone: 'UTC', numberingSystem: 'hanidec' }), '一九七〇/一/一 上午一二:〇〇:〇〇');47 shouldBe(new Date(0).toLocaleString('zh-Hans-CN-u-nu-hanidec', { timeZone: 'UTC' }), $vm.icuVersion() >= 69 ? '一九七〇/一/一 〇〇:〇〇:〇〇' : '一九七〇/一/一 上午一二:〇〇:〇〇'); 48 shouldBe(new Date(0).toLocaleString('zh-Hans-CN', { timeZone: 'UTC', numberingSystem: 'hanidec' }), $vm.icuVersion() >= 69 ? '一九七〇/一/一 〇〇:〇〇:〇〇' : '一九七〇/一/一 上午一二:〇〇:〇〇'); 49 49 shouldBe(new Date(0).toLocaleString('en-u-ca-chinese', { timeZone: 'UTC', year: 'numeric' }), '1969(ji-you)'); 50 50 shouldBe(new Date(0).toLocaleString('en', { timeZone: 'UTC', year: 'numeric', calendar: 'chinese' }), '1969(ji-you)'); … … 125 125 // Test that locale parameter is passed through properly. 126 126 shouldThrow(() => new Date().toLocaleTimeString('i'), RangeError); 127 shouldBe(new Date(0).toLocaleTimeString('zh-Hans-CN-u-nu-hanidec', { timeZone: 'UTC' }), "上午一二:〇〇:〇〇");128 shouldBe(new Date(0).toLocaleTimeString('zh-Hans-CN', { timeZone: 'UTC', numberingSystem: 'hanidec' }), "上午一二:〇〇:〇〇");127 shouldBe(new Date(0).toLocaleTimeString('zh-Hans-CN-u-nu-hanidec', { timeZone: 'UTC' }), $vm.icuVersion() >= 69 ? "〇〇:〇〇:〇〇" : "上午一二:〇〇:〇〇"); 128 shouldBe(new Date(0).toLocaleTimeString('zh-Hans-CN', { timeZone: 'UTC', numberingSystem: 'hanidec' }), $vm.icuVersion() >= 69 ? "〇〇:〇〇:〇〇" : "上午一二:〇〇:〇〇"); 129 129 shouldBe(new Date(0).toLocaleTimeString('en-u-ca-chinese', { timeZone: 'UTC', year: 'numeric' }), '1969(ji-you), 12:00:00 AM'); 130 130 shouldBe(new Date(0).toLocaleTimeString('en', { timeZone: 'UTC', year: 'numeric', calendar: 'chinese' }), '1969(ji-you), 12:00:00 AM'); -
trunk/JSTests/stress/intl-canonical-locale-alias-mapping.js
r275115 r286998 6 6 if (Intl.getCanonicalLocales('tl')[0] === 'fil') { 7 7 shouldBe(Intl.getCanonicalLocales('nb')[0], 'nb'); 8 shouldBe(Intl.getCanonicalLocales('no')[0], 'nb');8 shouldBe(Intl.getCanonicalLocales('no')[0], $vm.icuVersion() >= 69 ? 'no' : 'nb'); 9 9 shouldBe(Intl.getCanonicalLocales('iw')[0], 'he'); 10 10 shouldBe(Intl.getCanonicalLocales('prs')[0], 'fa-AF'); -
trunk/JSTests/stress/intl-datetimeformat-formatrange-relevant-extensions-ja.js
r276285 r286998 72 72 calendar: 'chinese' 73 73 }); 74 shouldBe(fmt2.format(date1), `丙戌年11月22日 2:00`);74 shouldBe(fmt2.format(date1), $vm.icuVersion() >= 69 ? `丙戌-11-22 2:00` : `丙戌年11月22日 2:00`); 75 75 shouldBe(fmt2.formatRange(date1, date2), `丙戌年11月22日 2時00分~3時00分`); 76 76 shouldBe(fmt2.formatRange(date1, date3), `丙戌年11月22日 2:00~丙戌年12月2日 2:00`); -
trunk/JSTests/stress/intl-datetimeformat-formatrangetoparts-relevant-extensions-ja.js
r276285 r286998 134 134 calendar: 'chinese' 135 135 }); 136 shouldBe(fmt2.format(date1), `丙戌年11月22日 2:00`);136 shouldBe(fmt2.format(date1), $vm.icuVersion() >= 69 ? `丙戌-11-22 2:00` : `丙戌年11月22日 2:00`); 137 137 shouldBeParts(fmt2.formatRangeToParts(date1, date2), [ 138 138 {"type":"yearName","value":"丙戌","source":"shared"}, -
trunk/JSTests/stress/intl-datetimeformat.js
r283446 r286998 758 758 } 759 759 { 760 shouldBe(new Date(0).toLocaleTimeString('zh-Hans-CN', { timeZone: 'UTC', numberingSystem: 'hanidec', hour: "numeric", minute: "numeric", second: "numeric", fractionalSecondDigits: 2 }), "上午一二:〇〇:〇〇.〇〇");760 shouldBe(new Date(0).toLocaleTimeString('zh-Hans-CN', { timeZone: 'UTC', numberingSystem: 'hanidec', hour: "numeric", minute: "numeric", second: "numeric", fractionalSecondDigits: 2 }), $vm.icuVersion() >= 69 ? "〇〇:〇〇:〇〇.〇〇" : "上午一二:〇〇:〇〇.〇〇"); 761 761 } 762 762 { -
trunk/JSTests/stress/intl-enumeration.js
r282925 r286998 27 27 let numberingSystems = Intl.supportedValuesOf("numberingSystem"); 28 28 let numberingSystemsString = JSON.stringify(numberingSystems); 29 shouldBe(numberingSystemsString === `["adlm","ahom","arab","arabext","bali","beng","bhks","brah","cakm","cham","deva","diak","fullwide","gong","gonm","gujr","guru","hanidec","hmng","hmnp","java","kali","khmr","knda","lana","lanatham","laoo","latn","lepc","limb","mathbold","mathdbl","mathmono","mathsanb","mathsans","mlym","modi","mong","mroo","mtei","mymr","mymrshan","mymrtlng","newa","nkoo","olck","orya","osma","rohg","saur","segment","shrd","sind","sinh","sora","sund","takr","talu","tamldec","telu","thai","tibt","tirh","vaii","wara","wcho"]` || numberingSystemsString === `["adlm","ahom","arab","arabext","bali","beng","bhks","brah","cakm","cham","deva","fullwide","gong","gonm","gujr","guru","hanidec","hmng","hmnp","java","kali","khmr","knda","lana","lanatham","laoo","latn","lepc","limb","mathbold","mathdbl","mathmono","mathsanb","mathsans","mlym","modi","mong","mroo","mtei","mymr","mymrshan","mymrtlng","newa","nkoo","olck","orya","osma","rohg","saur","shrd","sind","sinh","sora","sund","takr","talu","tamldec","telu","thai","tibt","tirh","vaii","wara","wcho"]`, true); 29 let ns1 = `["adlm","ahom","arab","arabext","bali","beng","bhks","brah","cakm","cham","deva","diak","fullwide","gong","gonm","gujr","guru","hanidec","hmng","hmnp","java","kali","khmr","knda","lana","lanatham","laoo","latn","lepc","limb","mathbold","mathdbl","mathmono","mathsanb","mathsans","mlym","modi","mong","mroo","mtei","mymr","mymrshan","mymrtlng","newa","nkoo","olck","orya","osma","rohg","saur","segment","shrd","sind","sinh","sora","sund","takr","talu","tamldec","telu","thai","tibt","tirh","vaii","wara","wcho"]`; 30 let ns2 = `["adlm","ahom","arab","arabext","bali","beng","bhks","brah","cakm","cham","deva","fullwide","gong","gonm","gujr","guru","hanidec","hmng","hmnp","java","kali","khmr","knda","lana","lanatham","laoo","latn","lepc","limb","mathbold","mathdbl","mathmono","mathsanb","mathsans","mlym","modi","mong","mroo","mtei","mymr","mymrshan","mymrtlng","newa","nkoo","olck","orya","osma","rohg","saur","shrd","sind","sinh","sora","sund","takr","talu","tamldec","telu","thai","tibt","tirh","vaii","wara","wcho"]`; 31 let ns3 = `["adlm","ahom","arab","arabext","bali","beng","bhks","brah","cakm","cham","deva","diak","fullwide","gong","gonm","gujr","guru","hanidec","hmng","hmnp","java","kali","khmr","knda","lana","lanatham","laoo","latn","lepc","limb","mathbold","mathdbl","mathmono","mathsanb","mathsans","mlym","modi","mong","mroo","mtei","mymr","mymrshan","mymrtlng","newa","nkoo","olck","orya","osma","rohg","saur","segment","shrd","sind","sinh","sora","sund","takr","talu","tamldec","telu","thai","tibt","tirh","tnsa","vaii","wara","wcho"]`; // ICU 70 adds "tnsa". 32 shouldBe(numberingSystemsString === ns1 || numberingSystemsString === ns2 || numberingSystemsString === ns3, true); 30 33 31 34 let timeZones = Intl.supportedValuesOf("timeZone"); -
trunk/JSTests/stress/intl-locale-info.js
r282257 r286998 81 81 shouldBe(JSON.stringify(locale.calendars), `["gregory","chinese"]`); 82 82 shouldBe(JSON.stringify(locale.collations), `["pinyin","big5han","gb2312","stroke","unihan","zhuyin","emoji","eor"]`); 83 shouldBe(JSON.stringify(locale.hourCycles), `["h12"]`);83 shouldBe(JSON.stringify(locale.hourCycles), $vm.icuVersion() >= 69 ? `["h23"]` : `["h12"]`); 84 84 shouldBe(JSON.stringify(locale.numberingSystems), `["latn"]`); 85 85 shouldBe(locale.timeZones, undefined); -
trunk/JSTests/stress/intl-locale.js
r266973 r286998 153 153 : 'en-Latn-US-variant-foobar-1abc-a-aa-aaa-u-kn-x-reserved' 154 154 ); 155 shouldBe(new Intl.Locale('cel-gaulish', { script: 'Arab', numberingSystem: 'gujr' }).toString(), 'xtg-Arab-u-nu-gujr-x-cel-gaulish');155 shouldBe(new Intl.Locale('cel-gaulish', { script: 'Arab', numberingSystem: 'gujr' }).toString(), $vm.icuVersion() >= 69 ? 'xtg-Arab-u-nu-gujr' : 'xtg-Arab-u-nu-gujr-x-cel-gaulish'); 156 156 shouldBe(new Intl.Locale('en-Latn-US-u-ca-gregory-co-phonebk-hc-h12-kf-upper-kn-false-nu-latn').toString(), 'en-Latn-US-u-ca-gregory-co-phonebk-hc-h12-kf-upper-kn-false-nu-latn'); 157 157
Note:
See TracChangeset
for help on using the changeset viewer.