Change test for -kn (#1995)

Add test for case of -kn-true
Verify no -kn-true nor -kn-false in the returned locale.
Change expectation per https://github.com/tc39/ecma402/pull/302
This commit is contained in:
Frank Yung-Fong Tang 2019-01-24 09:45:49 -08:00 committed by Leo Balter
parent b7c9c6c78b
commit 116c95d97c
1 changed files with 4 additions and 2 deletions

View File

@ -10,7 +10,7 @@ description: >
author: Norbert Lindenberg
---*/
var extensions = ["-u-co-phonebk-kn", "-u-kn-co-phonebk"];
var extensions = ["-u-co-phonebk-kn", "-u-kn-co-phonebk", "-u-co-phonebk-kn-true", "-u-kn-true-co-phonebk"];
extensions.forEach(function (extension) {
var defaultLocale = new Intl.Collator().resolvedOptions().locale;
var collator = new Intl.Collator([defaultLocale + extension], {usage: "sort"});
@ -18,6 +18,8 @@ extensions.forEach(function (extension) {
var numeric = collator.resolvedOptions().numeric;
if (numeric !== undefined) {
assert.sameValue(numeric, true, "Default value for \"kn\" should be true, but is " + numeric + ".");
assert.sameValue(locale.indexOf("-kn"), -1, "\"kn\" is returned in locale, but shouldn't be.");
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.");
}
});