From 47efdac8046903a13742e8d3b6d8aa55d7140d42 Mon Sep 17 00:00:00 2001 From: Frank Yung-Fong Tang <41213225+FrankYFTang@users.noreply.github.com> Date: Thu, 7 Feb 2019 15:55:34 -0800 Subject: [PATCH] split Split from intl402/Locale/constructor-non-iana-canon.js --- .../getCanonicalLocales/non-iana-canon.js | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 test/intl402/Intl/getCanonicalLocales/non-iana-canon.js diff --git a/test/intl402/Intl/getCanonicalLocales/non-iana-canon.js b/test/intl402/Intl/getCanonicalLocales/non-iana-canon.js new file mode 100644 index 0000000000..2a0e127337 --- /dev/null +++ b/test/intl402/Intl/getCanonicalLocales/non-iana-canon.js @@ -0,0 +1,37 @@ +// Copyright 2018 André Bargull; Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +// Slip from intl402/Locale/constructor-non-iana-canon.js +/*--- +esid: sec-intl.getcanonicallocales +description: > + Verifies canonicalization, of specific tags. +info: | + ApplyOptionsToTag( tag, options ) + 10. Return CanonicalizeLanguageTag(tag). +---*/ + +// Test some language tags where we know that either CLDR or ICU produce +// different results compared to the canonicalization specified in RFC 5646. +var testData = [ + { + tag: "mo", + canonical: "ro", + }, + { + tag: "hy-arevela", + canonical: "hy", + }, + { + tag: "hy-arevmda", + canonical: "hyw", + }, +]; + +for (const {tag, canonical = tag} of testData) { + assert.sameValue( + Intl.getCanonicalLocales(tag)[0], + canonical, + 'The value of Intl.getCanonicalLocales(tag)[0] equals the value of `canonical`' + ); +} -- GitLab