From 9345023d5f0880301e9342e942914c41d0a8519f Mon Sep 17 00:00:00 2001
From: Frank Yung-Fong Tang <41213225+FrankYFTang@users.noreply.github.com>
Date: Mon, 28 Jan 2019 08:55:57 -0800
Subject: [PATCH] move more cases from valid to invalid (#2047)

This is based on UTS35 in the new spec.
---
 .../intl402/Locale/constructor-options-language-valid.js | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/test/intl402/Locale/constructor-options-language-valid.js b/test/intl402/Locale/constructor-options-language-valid.js
index 5f9723432c..ef2d829143 100644
--- a/test/intl402/Locale/constructor-options-language-valid.js
+++ b/test/intl402/Locale/constructor-options-language-valid.js
@@ -15,6 +15,9 @@ info: |
     ApplyOptionsToTag( tag, options )
     ...
     2. If IsStructurallyValidLanguageTag(tag) is false, throw a RangeError exception.
+    3. Let language be ? GetOption(options, "language", "string", undefined, undefined).
+    4. If language is not undefined, then
+       a. If language does not match the unicode_language_subtag production, throw a RangeError exception.
 
     IsStructurallyValidLanguageTag ( locale )
 
@@ -28,9 +31,6 @@ features: [Intl.Locale]
 ---*/
 
 const validLanguageOptions = [
-  [null, 'null'],
-  ['zh-cmn', 'cmn'],
-  ['ZH-CMN', 'cmn'],
   [{ toString() { return 'de' } }, 'de'],
 ];
 for (const [language, expected] of validLanguageOptions) {
@@ -54,6 +54,9 @@ for (const [language, expected] of validLanguageOptions) {
 }
 
 const invalidLanguageOptions = [
+    null,
+    'zh-cmn',
+    'ZH-CMN',
     'abcd',
 ];
 for (const language of invalidLanguageOptions) {
-- 
GitLab