diff options
Diffstat (limited to 'deps/v8/test/intl/date-format/check-nu-option.js')
-rw-r--r-- | deps/v8/test/intl/date-format/check-nu-option.js | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/deps/v8/test/intl/date-format/check-nu-option.js b/deps/v8/test/intl/date-format/check-nu-option.js new file mode 100644 index 0000000000..7d4b4dc927 --- /dev/null +++ b/deps/v8/test/intl/date-format/check-nu-option.js @@ -0,0 +1,59 @@ +// Copyright 2018 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + + +let invalid_nu = [ + "invalid", + "abce", + "finance", + "native", + "traditio", +]; + +// https://tc39.github.io/ecma402/#table-numbering-system-digits +let valid_nu= [ + "arab", + "arabext", + "bali", + "beng", + "deva", + "fullwide", + "gujr", + "guru", + "hanidec", + "khmr", + "knda", + "laoo", + "latn", + "limb", + "mlym", + "mong", + "mymr", + "orya", + "tamldec", + "telu", + "thai", + "tibt", +]; + +let locales = [ + "en", + "ar", +]; + + +invalid_nu.forEach(function(nu) { + let df = new Intl.DateTimeFormat(["en-u-nu-" + nu + "-fo-obar"]); + assertEquals("en", df.resolvedOptions().locale); +} +); + +valid_nu.forEach(function(nu) { + locales.forEach(function(base) { + let l = base + "-u-nu-" + nu; + let df = new Intl.DateTimeFormat([l + "-fo-obar"]); + assertEquals(l, df.resolvedOptions().locale); + }); +} +); |