From 5112c1684a81674e1fd56d4f5789664b86a66d34 Mon Sep 17 00:00:00 2001 From: Ben Allen Date: Mon, 28 Aug 2023 08:59:52 -0700 Subject: [PATCH] changed order of parameters in assert.sameValue() tests --- .../resolvedOptions/hourCycle-default.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test/intl402/DateTimeFormat/prototype/resolvedOptions/hourCycle-default.js b/test/intl402/DateTimeFormat/prototype/resolvedOptions/hourCycle-default.js index 5bdd5c402b5..cd06a237eb7 100644 --- a/test/intl402/DateTimeFormat/prototype/resolvedOptions/hourCycle-default.js +++ b/test/intl402/DateTimeFormat/prototype/resolvedOptions/hourCycle-default.js @@ -1,4 +1,4 @@ -// Copyright 2019 Google Inc. All rights reserved. +// Copyright 2019 Google Inc., 2023 Igalia S.L. All rights reserved. // This code is governed by the license found in the LICENSE file. /*--- @@ -24,23 +24,23 @@ info: | locale: [en, fr, it, ja, zh, ko, ar, hi, en-u-hc-h24] ---*/ -let locales = ["en", "fr", "it", "ja", "zh", "ko", "ar", "hi", "en-u-hc-h24"]; +let locales = ["en", "fr", "it", "ja", "ja-u-hc-h11", "zh", "ko", "ar", "hi", "en-u-hc-h24"]; -locales.forEach(function(locale){ +locales.forEach(function(locale) { let hcDefault = new Intl.DateTimeFormat(locale, {hour: "numeric"}).resolvedOptions().hourCycle; if (hcDefault === "h11" || hcDefault === "h12"){ - assert.sameValue(hcDefault, new Intl.DateTimeFormat(locale, {hour: "numeric", hour12: true}).resolvedOptions().hourCycle); + assert.sameValue(new Intl.DateTimeFormat(locale, {hour: "numeric", hour12: true}).resolvedOptions().hourCycle, hcDefault); // no locale has "h24" as a default. see https://github.com/tc39/ecma402/pull/758#issue-1622377292 - assert.sameValue("h23", new Intl.DateTimeFormat(locale, {hour: "numeric", hour12: false}).resolvedOptions().hourCycle); + assert.sameValue(new Intl.DateTimeFormat(locale, {hour: "numeric", hour12: false}).resolvedOptions().hourCycle, "h23"); } - + // however, "h24" can be set via locale extension. if (hcDefault === "h23" || hcDefault === "h24") { - assert.sameValue(hcDefault, new Intl.DateTimeFormat(locale, {hour: "numeric", hour12: false}).resolvedOptions().hourCycle); + assert.sameValue(new Intl.DateTimeFormat(locale, {hour: "numeric", hour12: false}).resolvedOptions().hourCycle, hcDefault); } let hcHour12 = new Intl.DateTimeFormat(locale, {hour: "numeric", hour12: true}).resolvedOptions().hourCycle; - assert(hcHour12 === "h11" || hcHour12 === "h12", "Expected `hourCycle` to be in [\"h11\", \"h12\"]"); + assert(hcHour12 === "h11" || hcHour12 === "h12", "Expected `hourCycle`: " + hcHour12 + " to be in [\"h11\", \"h12\"]"); });