intl: increase coverage for the NumberFormat constructor

Increase coverage for the Intl.NumberFormat constructor by testing that
passing a string value to the Intl.NumberFormat constructor is
equivalent to passing an Array containing the same string value.
This commit is contained in:
Ujjwal Sharma 2018-10-02 01:18:23 +05:30 committed by Rick Waldron
parent e064fcd7ce
commit af0f53bb40
1 changed files with 19 additions and 0 deletions

View File

@ -0,0 +1,19 @@
// Copyright (C) 2018 Ujjwal Sharma. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-initializenumberformat
description: >
Tests that passing a string value to the Intl.NumberFormat constructor is
equivalent to passing an Array containing the same string value.
info: |
9.2.1 CanonicalizeLocaleList ( locales )
3 .If Type(locales) is String, then
a. Let O be CreateArrayFromList(« locales »).
---*/
const actual = Intl.NumberFormat('en-US');
const expected = Intl.NumberFormat(['en-US']);
assert.sameValue(actual.resolvedOptions(), expected.resolvedOptions());