summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSteven R. Loomis <srloomis@us.ibm.com>2018-08-07 11:37:12 -0700
committerSteven R. Loomis <srloomis@us.ibm.com>2018-10-23 13:32:40 -0700
commit4194b051e8271efc2f778d02cd8dec7030fb2a68 (patch)
tree5256e867834ecb643eaf5d113c5973f7f62e7dca /test
parentd36abb5d0b9470a237a2614c743ae28115bd86d6 (diff)
downloadandroid-node-v8-4194b051e8271efc2f778d02cd8dec7030fb2a68.tar.gz
android-node-v8-4194b051e8271efc2f778d02cd8dec7030fb2a68.tar.bz2
android-node-v8-4194b051e8271efc2f778d02cd8dec7030fb2a68.zip
deps: icu: apply workaround patch
ICU 62.1 had a bug where certain orders of operations would not work with the minimum significant digit setting. Fixed in ICU 63.1. Applied the following patch from v8. https://chromium-review.googlesource.com/c/chromium/deps/icu/+/1128503 ICU Bug: https://unicode-org.atlassian.net/browse/ICU-20063 Fixes: https://github.com/nodejs/node/issues/22156 PR-URL: https://github.com/nodejs/node/pull/23764 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/parallel/test-intl.js14
1 files changed, 12 insertions, 2 deletions
diff --git a/test/parallel/test-intl.js b/test/parallel/test-intl.js
index 618e8c49bc..c55f554b00 100644
--- a/test/parallel/test-intl.js
+++ b/test/parallel/test-intl.js
@@ -99,8 +99,18 @@ if (!common.hasIntl) {
assert.strictEqual(localeString, '1/1/1970, 12:00:00 AM');
}
// number format
- const numberFormat = new Intl.NumberFormat(['en']).format(12345.67890);
- assert.strictEqual(numberFormat, '12,345.679');
+ {
+ const numberFormat = new Intl.NumberFormat(['en']).format(12345.67890);
+ assert.strictEqual(numberFormat, '12,345.679');
+ }
+ // Significant Digits
+ {
+ const loc = ['en-US'];
+ const opts = { maximumSignificantDigits: 4 };
+ const num = 10.001;
+ const numberFormat = new Intl.NumberFormat(loc, opts).format(num);
+ assert.strictEqual(numberFormat, '10');
+ }
const collOpts = { sensitivity: 'base', ignorePunctuation: true };
const coll = new Intl.Collator(['en'], collOpts);