v8/test/intl/relative-time-format/resolved-options-nu-extended.js
Frank Tang e0de3b6d42 Fix android test breakage due to lack of locale
Only run the test when locale 'bn' is supported

Bug: v8:9100
Change-Id: I455d77a7fb7495f1f866211084cdb68fceb8c871
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2130069
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66956}
2020-04-01 21:34:33 +00:00

31 lines
1.0 KiB
JavaScript

// 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.
// Testing 'bn' locale with -u-nu.
// Split from test/intl/relative-time-format/resolved-options-nu.js
// because Android not yet include bn locale data.
// Only test if the browser support 'bn' locale
if (Intl.RelativeTimeFormat.supportedLocalesOf(["bn"]).length > 0) {
// For locale default the numberingSystem to other than 'latn'
assertEquals(
"beng",
new Intl.RelativeTimeFormat("bn").resolvedOptions().numberingSystem
);
// For locale which default others but use -u-nu-latn to change to 'latn'
// numberingSystem
assertEquals(
"latn",
new Intl.RelativeTimeFormat("bn-u-nu-latn").resolvedOptions()
.numberingSystem
);
// For locale use -u-nu- with invalid value still back to default.
assertEquals(
"beng",
new Intl.RelativeTimeFormat("bn-u-nu-abcd").resolvedOptions()
.numberingSystem
);
}