blob: 36d75722ea0c226efa4dc022c4a4cf8a0c154ba2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
// Copyright 2019 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Except when the notation is "compact", the resolvedOptions().compactDisplay
// should be undefined.
//
// Test default
let nf = new Intl.NumberFormat();
assertEquals(undefined, nf.resolvedOptions().compactDisplay);
nf = new Intl.NumberFormat("en");
assertEquals(undefined, nf.resolvedOptions().compactDisplay);
const testData = [
["scientific"],
["engineering"],
["standard"],
];
for (const [notation] of testData) {
nf = new Intl.NumberFormat("en", {notation});
assertEquals(undefined, nf.resolvedOptions().compactDisplay);
for (const compactDisplay of ["short", "long"]) {
nf = new Intl.NumberFormat("en", {compactDisplay, notation});
assertEquals(undefined, nf.resolvedOptions().compactDisplay);
}
}
|