* Throw if |parent| is not a more general language tag of |child|, nor |child| * itself, per BCP 47 rules.
(child, parent)
| 282 | * itself, per BCP 47 rules. |
| 283 | */ |
| 284 | function assertLanguageTag(child, parent) { |
| 285 | var childSplit = splitLanguageTag(child); |
| 286 | var parentSplit = splitLanguageTag(parent); |
| 287 | |
| 288 | // Do not compare extensions at this moment, as %GetDefaultICULocale() |
| 289 | // doesn't always output something we support. |
| 290 | if (childSplit.locale !== parentSplit.locale && |
| 291 | !childSplit.locale.startsWith(parentSplit.locale + '-')) { |
| 292 | fail(child, parent, 'language tag comparison'); |
| 293 | } |
| 294 | } |
| 295 | |
| 296 | function assertArrayEquals(expected, found, name_opt) { |
| 297 | var start = ""; |
no test coverage detected
searching dependent graphs…