From 46515dcb194720afa4f71615aef7f6a4fc3d86cb Mon Sep 17 00:00:00 2001 From: Ujjwal Sharma Date: Thu, 8 Nov 2018 11:37:02 +0530 Subject: [PATCH] intl: increase coverage for DateTimeFormat Increase coverage for the Intl.DateTimeFormat constructor by adding a test that checks for the default values. --- .../constructor-default-value.js | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 test/intl402/DateTimeFormat/constructor-default-value.js diff --git a/test/intl402/DateTimeFormat/constructor-default-value.js b/test/intl402/DateTimeFormat/constructor-default-value.js new file mode 100644 index 0000000000..132ba4c24b --- /dev/null +++ b/test/intl402/DateTimeFormat/constructor-default-value.js @@ -0,0 +1,23 @@ +// Copyright (C) 2018 Ujjwal Sharma. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-initializedatetimeformat +description: > + Tests that the constructor for Intl.DateTimeFormat uses appropriate default + values for its arguments (locales and options). +---*/ + +const actual = new Intl.DateTimeFormat().resolvedOptions(); +const expected = new Intl.DateTimeFormat( + [], + Object.create(null) +).resolvedOptions(); + +assert.sameValue(actual.locale, expected.locale); +assert.sameValue(actual.calendar, expected.calendar); +assert.sameValue(actual.day, expected.day); +assert.sameValue(actual.month, expected.month); +assert.sameValue(actual.year, expected.year); +assert.sameValue(actual.numberingSystem, expected.numberingSystem); +assert.sameValue(actual.timeZone, expected.timeZone);