My working unpac space for OCaml projects in development
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

[Temporal] Make DateTimeFormat tests for Chinese and Dangi dates more lenient (#4771)

These tests were failing in JSC because it formats the '1' in one of the
dates with a leading 0 ( https://bugs.webkit.org/show_bug.cgi?id=303776 ).
Fixed to check that the actual string contains at most one leading zero,
rather than an exact match.

authored by

Tim Chevalier and committed by
GitHub
75a498d3 a10a69c0

+16 -4
+4 -1
vendor/git/test262/test/intl402/DateTimeFormat/prototype/formatRangeToParts/chinese-calendar-dates.js
··· 22 22 const part = actualComponents.find(({type, source}) => type === expectedType && source == sourceVal); 23 23 const contextMessage = `${expectedType} component of ${isoString} formatted in ${calendar}`; 24 24 assert.notSameValue(part, undefined, contextMessage); 25 - assert.sameValue(part.value, `${expectedValue}`, contextMessage); 25 + if (typeof part.value === "string") 26 + assert(part.value === expectedValue || (expectedValue.length === 1 && part.value === '0' + expectedValue)); 27 + else 28 + assert.sameValue(part.value, `${expectedValue}`, contextMessage); 26 29 } 27 30 } 28 31
+4 -1
vendor/git/test262/test/intl402/DateTimeFormat/prototype/formatRangeToParts/dangi-calendar-dates.js
··· 22 22 const part = actualComponents.find(({type, source}) => type === expectedType && source == sourceVal); 23 23 const contextMessage = `${expectedType} component of ${isoString} formatted in ${calendar}`; 24 24 assert.notSameValue(part, undefined, contextMessage); 25 - assert.sameValue(part.value, `${expectedValue}`, contextMessage); 25 + if (typeof part.value === "string") 26 + assert(part.value === expectedValue || (expectedValue.length === 1 && part.value === '0' + expectedValue)); 27 + else 28 + assert.sameValue(part.value, `${expectedValue}`, contextMessage); 26 29 } 27 30 } 28 31
+4 -1
vendor/git/test262/test/intl402/DateTimeFormat/prototype/formatToParts/chinese-calendar-dates.js
··· 19 19 const part = actualComponents.find(({type}) => type === expectedType); 20 20 const contextMessage = `${expectedType} component of ${isoString} formatted in ${calendar}`; 21 21 assert.notSameValue(part, undefined, contextMessage); 22 - assert.sameValue(part.value, `${expectedValue}`, contextMessage); 22 + if (typeof part.value === "string") 23 + assert(part.value === expectedValue || (expectedValue.length === 1 && part.value === '0' + expectedValue)); 24 + else 25 + assert.sameValue(part.value, `${expectedValue}`, contextMessage); 23 26 } 24 27 } 25 28
+4 -1
vendor/git/test262/test/intl402/DateTimeFormat/prototype/formatToParts/dangi-calendar-dates.js
··· 22 22 const part = actualComponents.find(({type}) => type === expectedType); 23 23 const contextMessage = `${expectedType} component of ${isoString} formatted in ${calendar}`; 24 24 assert.notSameValue(part, undefined, contextMessage); 25 - assert.sameValue(part.value, `${expectedValue}`, contextMessage); 25 + if (typeof part.value === "string") 26 + assert(part.value === expectedValue || (expectedValue.length === 1 && part.value === '0' + expectedValue)); 27 + else 28 + assert.sameValue(part.value, `${expectedValue}`, contextMessage); 26 29 } 27 30 } 28 31