From 532206a9bd45c91b96115a404b3e8f38a423bd06 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Wed, 1 May 2019 19:05:25 +0200 Subject: [PATCH] Add some more BigInt.prototype.toLocaleString tests. (#2136) --- .../BigInt/prototype/toLocaleString/de-DE.js | 23 +++++++++++++++++++ .../BigInt/prototype/toLocaleString/en-US.js | 1 + 2 files changed, 24 insertions(+) create mode 100644 test/intl402/BigInt/prototype/toLocaleString/de-DE.js diff --git a/test/intl402/BigInt/prototype/toLocaleString/de-DE.js b/test/intl402/BigInt/prototype/toLocaleString/de-DE.js new file mode 100644 index 0000000000..5dffd0f530 --- /dev/null +++ b/test/intl402/BigInt/prototype/toLocaleString/de-DE.js @@ -0,0 +1,23 @@ +// Copyright (C) 2019 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-bigint.prototype.tolocalestring +description: Checks basic behavior for BigInt.prototype.toLocaleString. +locale: [de-DE] +features: [BigInt] +---*/ + +const tests = [ + [0n, undefined, "0"], + [-0n, undefined, "0"], + [88776655n, { "maximumSignificantDigits": 4 }, "88.780.000"], + [88776655n, { "maximumSignificantDigits": 4, "style": "percent" }, "8.878.000.000\u00a0%"], + [88776655n, { "minimumFractionDigits": 3 }, "88.776.655,000"], + [90071992547409910n, undefined, "90.071.992.547.409.910"], +]; + +for (const [bigint, options, expected] of tests) { + const result = bigint.toLocaleString("de-DE", options); + assert.sameValue(result, expected); +} diff --git a/test/intl402/BigInt/prototype/toLocaleString/en-US.js b/test/intl402/BigInt/prototype/toLocaleString/en-US.js index 13c75d93a8..f5a5fb83e1 100644 --- a/test/intl402/BigInt/prototype/toLocaleString/en-US.js +++ b/test/intl402/BigInt/prototype/toLocaleString/en-US.js @@ -14,6 +14,7 @@ const tests = [ [88776655n, { "maximumSignificantDigits": 4 }, "88,780,000"], [88776655n, { "maximumSignificantDigits": 4, "style": "percent" }, "8,878,000,000%"], [88776655n, { "minimumFractionDigits": 3 }, "88,776,655.000"], + [90071992547409910n, undefined, "90,071,992,547,409,910"], ]; for (const [bigint, options, expected] of tests) {