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.

Fix format parts test

Two issues:
1. `typeof part.value` is always a String value.
2. `expectedValue` is a Number value, but the test expected a String.

authored by

André Bargull and committed by
Philip Chimento
cdd64ddc 96f304b5

+28 -20
+7 -5
vendor/git/test262/test/intl402/DateTimeFormat/prototype/formatRangeToParts/chinese-calendar-dates.js
··· 21 21 for (let [expectedType, expectedValue] of Object.entries(list)) { 22 22 const part = actualComponents.find(({type, source}) => type === expectedType && source == sourceVal); 23 23 const contextMessage = `${expectedType} component of ${isoString} formatted in ${calendar}`; 24 - assert.notSameValue(part, undefined, 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); 24 + assert.notSameValue(part, undefined, `${contextMessage} is missing`); 25 + assert.sameValue(typeof part.value, "string", `${contextMessage} is not a string`); 26 + assert( 27 + part.value === String(expectedValue) || 28 + part.value === String(expectedValue).padStart(2, "0"), 29 + `${contextMessage} has unexpected value` 30 + ); 29 31 } 30 32 } 31 33
+7 -5
vendor/git/test262/test/intl402/DateTimeFormat/prototype/formatRangeToParts/dangi-calendar-dates.js
··· 21 21 for (let [expectedType, expectedValue] of Object.entries(list)) { 22 22 const part = actualComponents.find(({type, source}) => type === expectedType && source == sourceVal); 23 23 const contextMessage = `${expectedType} component of ${isoString} formatted in ${calendar}`; 24 - assert.notSameValue(part, undefined, 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); 24 + assert.notSameValue(part, undefined, `${contextMessage} is missing`); 25 + assert.sameValue(typeof part.value, "string", `${contextMessage} is not a string`); 26 + assert( 27 + part.value === String(expectedValue) || 28 + part.value === String(expectedValue).padStart(2, "0"), 29 + `${contextMessage} has unexpected value` 30 + ); 29 31 } 30 32 } 31 33
+7 -5
vendor/git/test262/test/intl402/DateTimeFormat/prototype/formatToParts/chinese-calendar-dates.js
··· 18 18 for (let [expectedType, expectedValue] of Object.entries(expectedComponents)) { 19 19 const part = actualComponents.find(({type}) => type === expectedType); 20 20 const contextMessage = `${expectedType} component of ${isoString} formatted in ${calendar}`; 21 - assert.notSameValue(part, undefined, 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); 21 + assert.notSameValue(part, undefined, `${contextMessage} is missing`); 22 + assert.sameValue(typeof part.value, "string", `${contextMessage} is not a string`); 23 + assert( 24 + part.value === String(expectedValue) || 25 + part.value === String(expectedValue).padStart(2, "0"), 26 + `${contextMessage} has unexpected value` 27 + ); 26 28 } 27 29 } 28 30
+7 -5
vendor/git/test262/test/intl402/DateTimeFormat/prototype/formatToParts/dangi-calendar-dates.js
··· 21 21 for (let [expectedType, expectedValue] of Object.entries(expectedComponents)) { 22 22 const part = actualComponents.find(({type}) => type === expectedType); 23 23 const contextMessage = `${expectedType} component of ${isoString} formatted in ${calendar}`; 24 - assert.notSameValue(part, undefined, 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); 24 + assert.notSameValue(part, undefined, `${contextMessage} is missing`); 25 + assert.sameValue(typeof part.value, "string", `${contextMessage} is not a string`); 26 + assert( 27 + part.value === String(expectedValue) || 28 + part.value === String(expectedValue).padStart(2, "0"), 29 + `${contextMessage} has unexpected value` 30 + ); 29 31 } 30 32 } 31 33