v8/test/intl/general/invalid-locale.js
Jungshik Shin a46bc03591 Prepare for ICU roll to 63.1
In Chromium tree, ICU is rolled to 63.1. And, auto-roller will soon
try to roll ICU in v8 to 63.1.  Due to a nodejs trybot issue,
autoroll needs a manual intervention. In the meantime, this CL
will get rid of other blocking issues for ICU update.

Prepare for the ICU roll by revising test/intl as following:

* Line breaking loose mode is now supported in the
Chromium's copy of ICU. Adjust the test expectation.

* ICU's uloc_* can handle overlong locale ids. Drop tests
that are not valid any more.

Once ICU is rolled, a couple of TSAN-suppressed tests can
be unsuppressed, but that has to be done in a separate CL.

Bug: chromium:893196,v8:8272, v8:8110
Test: intl/*, test262/test402/*
Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
Change-Id: I17f11457b61376b1e8d41bbbc951fa6cd3355a54
Reviewed-on: https://chromium-review.googlesource.com/c/1289369
Commit-Queue: Jungshik Shin <jshin@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57105}
2018-10-30 05:01:18 +00:00

25 lines
950 B
JavaScript

// Copyright 2017 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.
// Make sure that invalid locales throw RangeError
var invalid_locales = ["arcdefghl-Latn", "fil-Latn-kxx", "fr-Latn-CAK",
"en-Latin-US", "en-a-foo-9charlong", "en-a-b",
];
for (let locale of invalid_locales) {
assertThrows("var nf = new Intl.NumberFormat('" + locale + "')", RangeError);
}
var not_so_long_locales = [
"bs-u-nu-bzcu-cab-cabs-avnlubs-avnihu-zcu-cab-cbs-avnllubs-avnihq-zcu-cab-cbs-ubs-avnihu-cabs-flus-xxd-vnluy",
"bs-u-nu-bzcu-cab-cabs-avnlubs-avnihu-zcu-cab-cbs-avnllubs-avnihq-zcu-cab-cbs-ubs-avnihu-cabs-flus-xxd",
"bs-u-nu-bzcu-cab-cabs-avnlubs-avnihu-zcu",
];
for (let locale of not_so_long_locales) {
assertEquals((new Intl.NumberFormat(locale)).resolvedOptions().numberingSystem,
"latn");
}