@@ -13,6 +13,8 @@ ruleTester.run('template-require-lang-attribute', rule, {
1313 '<template><html lang="en"></html></template>' ,
1414 '<template><html lang="en-US"></html></template>' ,
1515 '<template><html lang="DE-BW"></html></template>' ,
16+ '<template><html lang="zh-Hant-HK"></html></template>' ,
17+ '<template><html lang="yue-Hans"></html></template>' ,
1618 '<template><html lang={{lang}}></html></template>' ,
1719 {
1820 code : '<template><html lang="de"></html></template>' ,
@@ -66,6 +68,14 @@ ruleTester.run('template-require-lang-attribute', rule, {
6668 options : [ { validateValues : true } ] ,
6769 errors : [ { message : ERROR_MESSAGE } ] ,
6870 } ,
71+ {
72+ // Invalid region subtag: "xx" is not a registered ISO 3166 / BCP 47
73+ // region code. Prior to the country-codes port, the rule only
74+ // validated the primary subtag and incorrectly accepted this value.
75+ code : '<template><html lang="en-XX"></html></template>' ,
76+ output : null ,
77+ errors : [ { message : ERROR_MESSAGE } ] ,
78+ } ,
6979 {
7080 code : '<template><html></html></template>' ,
7181 output : null ,
@@ -94,6 +104,8 @@ hbsRuleTester.run('template-require-lang-attribute', rule, {
94104 '<html lang="en"></html>' ,
95105 '<html lang="en-US"></html>' ,
96106 '<html lang="DE-BW"></html>' ,
107+ '<html lang="zh-Hant-HK"></html>' ,
108+ '<html lang="yue-Hans"></html>' ,
97109 '<html lang={{lang}}></html>' ,
98110 {
99111 code : '<html lang="de"></html>' ,
@@ -146,6 +158,14 @@ hbsRuleTester.run('template-require-lang-attribute', rule, {
146158 options : [ { validateValues : true } ] ,
147159 errors : [ { message : ERROR_MESSAGE } ] ,
148160 } ,
161+ {
162+ // Invalid region subtag: "xx" is not a registered ISO 3166 / BCP 47
163+ // region code. Prior to the country-codes port, the rule only
164+ // validated the primary subtag and incorrectly accepted this value.
165+ code : '<html lang="en-XX"></html>' ,
166+ output : null ,
167+ errors : [ { message : ERROR_MESSAGE } ] ,
168+ } ,
149169 {
150170 code : '<html></html>' ,
151171 output : null ,
0 commit comments