From de416c28c3b704bd692af3a8436201710e58b77e Mon Sep 17 00:00:00 2001 From: Ujjwal Sharma <usharma1998@gmail.com> Date: Tue, 2 Oct 2018 01:59:01 +0530 Subject: [PATCH] intl: increase coverage from the NumberFormat constructor Improve coverage for the Intl.NumberFormat constructor by testing that it accepts Array-like objects and handles them properly. --- .../constructor-locales-arraylike.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 test/intl402/NumberFormat/constructor-locales-arraylike.js diff --git a/test/intl402/NumberFormat/constructor-locales-arraylike.js b/test/intl402/NumberFormat/constructor-locales-arraylike.js new file mode 100644 index 0000000000..122e14e47e --- /dev/null +++ b/test/intl402/NumberFormat/constructor-locales-arraylike.js @@ -0,0 +1,17 @@ +// 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 the Intl.NumberFormat constructor accepts Array-like values for the + locales argument and treats them well. +---*/ + +const actual = Intl.NumberFormat({ + length: 1, + 1: 'en-US' +}); +const expected = Intl.NumberFormat(['en-US']); + +assert.sameValue(actual.resolvedOptions(), expected.resolvedOptions()); -- GitLab