2012-08-27 05:49:25 +02:00
|
|
|
// Copyright 2011-2012 Norbert Lindenberg. All rights reserved.
|
|
|
|
// Copyright 2012 Mozilla Corporation. All rights reserved.
|
|
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
|
|
|
|
2014-07-22 01:09:02 +02:00
|
|
|
/*---
|
2014-07-25 00:41:42 +02:00
|
|
|
es5id: 9.2.5_11_g_ii_2
|
2014-07-22 01:09:02 +02:00
|
|
|
description: >
|
|
|
|
Tests that missing Unicode extension values default to true for
|
|
|
|
boolean keys.
|
|
|
|
author: Norbert Lindenberg
|
|
|
|
---*/
|
2012-08-27 05:49:25 +02:00
|
|
|
|
2019-01-24 18:45:49 +01:00
|
|
|
var extensions = ["-u-co-phonebk-kn", "-u-kn-co-phonebk", "-u-co-phonebk-kn-true", "-u-kn-true-co-phonebk"];
|
2012-08-27 05:49:25 +02:00
|
|
|
extensions.forEach(function (extension) {
|
|
|
|
var defaultLocale = new Intl.Collator().resolvedOptions().locale;
|
|
|
|
var collator = new Intl.Collator([defaultLocale + extension], {usage: "sort"});
|
|
|
|
var locale = collator.resolvedOptions().locale;
|
|
|
|
var numeric = collator.resolvedOptions().numeric;
|
|
|
|
if (numeric !== undefined) {
|
2017-05-04 21:10:58 +02:00
|
|
|
assert.sameValue(numeric, true, "Default value for \"kn\" should be true, but is " + numeric + ".");
|
2019-01-24 18:45:49 +01:00
|
|
|
assert.sameValue(locale.indexOf("-kn-false"), -1, "\"kn-false\" is returned in locale, but shouldn't be.");
|
|
|
|
assert.sameValue(locale.indexOf("-kn-true"), -1, "\"kn-true\" is returned in locale, but shouldn't be.");
|
|
|
|
assert.sameValue(locale.indexOf("-kn") >= 0, true, "\"kn\" should be returned in locale.");
|
2012-08-27 05:49:25 +02:00
|
|
|
}
|
|
|
|
});
|