From 780b7b806eb6c73122f82ec8dbbe7f74bb7475bf Mon Sep 17 00:00:00 2001 From: Romulo Cintra Date: Wed, 11 Jan 2023 11:37:18 +0100 Subject: [PATCH] Add test to approximately format --- .../prototype/formatRangeToParts/en-US.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/test/intl402/NumberFormat/prototype/formatRangeToParts/en-US.js b/test/intl402/NumberFormat/prototype/formatRangeToParts/en-US.js index 5f5d1c69f9..1133022694 100644 --- a/test/intl402/NumberFormat/prototype/formatRangeToParts/en-US.js +++ b/test/intl402/NumberFormat/prototype/formatRangeToParts/en-US.js @@ -23,7 +23,7 @@ function compare(actual, expected) { assert.sameValue(actualEntry.type, expectedEntry.type, `type for entry ${i}`); assert.sameValue(actualEntry.value, expectedEntry.value, `value for entry ${i}`); assert.sameValue(actualEntry.source, expectedEntry.source, `source for entry ${i}`); - + // 1.1.25_4.a Let O be ObjectCreate(%ObjectPrototype%). assert.sameValue(Object.getPrototypeOf(actualEntry), Object.prototype, `prototype for entry ${i}`); // 1.1.25_4.b Perform ! CreateDataPropertyOrThrow(O, "type", part.[[Type]]) @@ -49,3 +49,17 @@ compare(nf.formatRangeToParts(3, 5), [ {type: "currency", value: "$", source: "endRange"}, {type: "integer", value: "5", source: "endRange"} ]); + +compare(nf.formatRangeToParts(1, 1), [ + {type: 'approximatelySign', value: '~', source: 'shared'}, + {type: 'currency', value: '$', source: 'shared'}, + {type: 'integer', value: '1', source: 'shared'} +]); + +compare(nf.formatRangeToParts(2.999, 3.001), [ + {type: 'approximatelySign', value: '~', source: 'shared'}, + {type: 'currency', value: '$', source: 'shared'}, + {type: 'integer', value: '3', source: 'shared'} +]); + +