From da4f4385fdf88ff2c8acf036efaaa62f8cd6bd58 Mon Sep 17 00:00:00 2001
From: jungshik <jungshik@users.noreply.github.com>
Date: Mon, 12 Sep 2016 12:54:55 -0700
Subject: [PATCH] islamicc should be canonicalized to islamic-civil (#747)

Moves ismalicc test out of main.js and creates a new
test, preferred-subtag.js (per RFC 5646 section 4.5 and
http://www.unicode.org/repos/cldr/tags/latest/common/bcp47/calendar.xml
)

Fix #743
---
 test/intl402/Intl/getCanonicalLocales/main.js |  2 --
 .../getCanonicalLocales/preferred-subtag.js   | 24 +++++++++++++++++++
 2 files changed, 24 insertions(+), 2 deletions(-)
 create mode 100644 test/intl402/Intl/getCanonicalLocales/preferred-subtag.js

diff --git a/test/intl402/Intl/getCanonicalLocales/main.js b/test/intl402/Intl/getCanonicalLocales/main.js
index f518a5005d..ae088b38a2 100644
--- a/test/intl402/Intl/getCanonicalLocales/main.js
+++ b/test/intl402/Intl/getCanonicalLocales/main.js
@@ -29,6 +29,4 @@ assertArray(gCL({'a': 0}), []);
 
 assertArray(gCL({}), []);
 
-assertArray(gCL(['ar-ma-u-ca-islamicc']), ['ar-MA-u-ca-islamicc']);
-
 assertArray(gCL(['th-th-u-nu-thai']), ['th-TH-u-nu-thai']);
diff --git a/test/intl402/Intl/getCanonicalLocales/preferred-subtag.js b/test/intl402/Intl/getCanonicalLocales/preferred-subtag.js
new file mode 100644
index 0000000000..23b37a98c9
--- /dev/null
+++ b/test/intl402/Intl/getCanonicalLocales/preferred-subtag.js
@@ -0,0 +1,24 @@
+// Copyright 2016 Mozilla Corporation. All rights reserved.
+// This code is governed by the license found in the LICENSE file.
+
+/*---
+esid: sec-canonicalizelanguagetag
+description: Test for the replacement of a deprecated subtag with its preferred subtag.
+info: |
+  6.2.3 CanonicalizeLanguageTag ( locale )
+   It takes the steps specified in RFC 5646 section 4.5, or successor, to bring the language
+   tag into canonical form, and to regularize the case of the subtags.
+   RFC 5646 section 4.5 - 3rd point: Subtags are replaced by their
+   'Preferred-Value', if there is one.
+includes: [compareArray.js]
+---*/
+
+var gCL = Intl.getCanonicalLocales;
+
+function assertArray(l, r) {
+  assert(compareArray(l, r), r);
+}
+
+// islamicc is deprecated and its preferred name is 'islamic-civil'.
+// See http://www.unicode.org/repos/cldr/tags/latest/common/bcp47/calendar.xml .
+assertArray(gCL(['ar-ma-u-ca-islamicc']), ['ar-MA-u-ca-islamic-civil']);
-- 
GitLab