Changeset 292481 in webkit
- Timestamp:
- Apr 6, 2022 11:21:47 AM (2 years ago)
- Location:
- trunk/JSTests
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JSTests/ChangeLog
r292217 r292481 1 2022-04-06 Alexey Shvayka <ashvayka@apple.com> 2 3 ICU was recently updated to use type="long" format if there is {month: "long"} 4 https://bugs.webkit.org/show_bug.cgi?id=238852 5 <rdar://90462186> 6 7 Reviewed by Saam Barati. 8 9 Since this update [1] is not yet released, we can't set expectations based on major / minor 10 ICU version, this patch loosens the tests to accept either of the format types. 11 12 [1]: https://github.com/unicode-org/icu/commit/23081486ffec0973b01e66e2cbad93a1a7dec267 13 14 * stress/date-toLocaleString.js: 15 * stress/intl-datetimeformat.js: 16 1 17 2022-04-01 Angelos Oikonomopoulos <angelos@igalia.com> 2 18 -
trunk/JSTests/stress/date-toLocaleString.js
r286998 r292481 138 138 shouldBe(new Date(0).toLocaleTimeString('en', { timeZone: 'UTC', hour: 'numeric', minute: '2-digit' }), '12:00 AM'); 139 139 // Adds hms if no time formats specified. 140 shouldBe(new Date(0).toLocaleTimeString('en', { timeZone: 'UTC', year: 'numeric', month: 'long' }), 'January 1970, 12:00:00 AM'); 140 // See https://bugs.webkit.org/show_bug.cgi?id=238852 141 const monthLongTimeString = new Date(0).toLocaleTimeString('en', { timeZone: 'UTC', year: 'numeric', month: 'long' }); 142 if (monthLongTimeString !== 'January 1970, 12:00:00 AM' && 143 monthLongTimeString !== 'January 1970 at 12:00:00 AM') 144 throw new Error(`Unexpected time string for {month: 'long'}: ${monthLongTimeString}`); -
trunk/JSTests/stress/intl-datetimeformat.js
r286998 r292481 637 637 638 638 // Exceed the 32 character default buffer size 639 shouldBe( 639 const actualMonthLongParts = 640 640 JSON.stringify( 641 641 Intl.DateTimeFormat('en-US', { … … 644 644 timeZoneName: 'long', era: 'long', timeZone: 'America/Los_Angeles' 645 645 }).formatToParts(0) 646 ), 646 ); 647 648 const getExpectedMonthLongParts = separator => ( 647 649 JSON.stringify([ 648 650 { type: 'weekday', value: 'Wednesday' }, … … 655 657 { type: 'literal', value: ' ' }, 656 658 { type: 'era', value: 'Anno Domini' }, 657 { type: 'literal', value: ', '},659 { type: 'literal', value: separator }, 658 660 { type: 'hour', value: '4' }, 659 661 { type: 'literal', value: ':' }, … … 667 669 ]) 668 670 ); 671 672 // See https://bugs.webkit.org/show_bug.cgi?id=238852 673 if (actualMonthLongParts !== getExpectedMonthLongParts(', ') && actualMonthLongParts !== getExpectedMonthLongParts(' at ')) 674 throw new Error(`Unexpected format parts for {month: 'long'}: ${actualMonthLongParts}`); 669 675 670 676 // Tests for relativeYear and yearName
Note: See TracChangeset
for help on using the changeset viewer.