mirror of
https://github.com/nodejs/node.git
synced 2025-05-19 11:32:42 +00:00

PR-URL: https://github.com/nodejs/node/pull/27375 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
82 lines
2.1 KiB
JavaScript
82 lines
2.1 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.
|
|
|
|
// For locale default the numberingSystem to 'latn'
|
|
assertEquals(
|
|
"latn",
|
|
new Intl.RelativeTimeFormat("ar").resolvedOptions().numberingSystem
|
|
);
|
|
assertEquals(
|
|
"latn",
|
|
new Intl.RelativeTimeFormat("en").resolvedOptions().numberingSystem
|
|
);
|
|
assertEquals(
|
|
"latn",
|
|
new Intl.RelativeTimeFormat("fr").resolvedOptions().numberingSystem
|
|
);
|
|
assertEquals(
|
|
"latn",
|
|
new Intl.RelativeTimeFormat("hi").resolvedOptions().numberingSystem
|
|
);
|
|
assertEquals(
|
|
"latn",
|
|
new Intl.RelativeTimeFormat("th").resolvedOptions().numberingSystem
|
|
);
|
|
assertEquals(
|
|
"latn",
|
|
new Intl.RelativeTimeFormat("zh-Hant").resolvedOptions().numberingSystem
|
|
);
|
|
|
|
// For locale default the numberingSystem to other than 'latn'
|
|
assertEquals(
|
|
"arab",
|
|
new Intl.RelativeTimeFormat("ar-TD").resolvedOptions().numberingSystem
|
|
);
|
|
assertEquals(
|
|
"arabext",
|
|
new Intl.RelativeTimeFormat("fa").resolvedOptions().numberingSystem
|
|
);
|
|
|
|
// For locale use -u-nu- to change to other numberingSystem
|
|
assertEquals(
|
|
"thai",
|
|
new Intl.RelativeTimeFormat("en-u-nu-thai").resolvedOptions()
|
|
.numberingSystem
|
|
);
|
|
assertEquals(
|
|
"arab",
|
|
new Intl.RelativeTimeFormat("en-u-nu-arab").resolvedOptions()
|
|
.numberingSystem
|
|
);
|
|
|
|
// For locale which default others but use -u-nu-latn to change to 'latn' numberingSystem
|
|
assertEquals(
|
|
"latn",
|
|
new Intl.RelativeTimeFormat("fa-u-nu-latn").resolvedOptions()
|
|
.numberingSystem
|
|
);
|
|
assertEquals(
|
|
"latn",
|
|
new Intl.RelativeTimeFormat("ar-TD-u-nu-latn").resolvedOptions()
|
|
.numberingSystem
|
|
);
|
|
assertEquals(
|
|
"latn",
|
|
new Intl.RelativeTimeFormat("fa-u-nu-latn").resolvedOptions()
|
|
.numberingSystem
|
|
);
|
|
|
|
// For locale use -u-nu- with invalid value still back to default.
|
|
assertEquals(
|
|
"latn",
|
|
new Intl.RelativeTimeFormat("en-u-nu-abcd").resolvedOptions()
|
|
.numberingSystem
|
|
);
|
|
|
|
assertEquals(
|
|
"arabext",
|
|
new Intl.RelativeTimeFormat("fa-u-nu-abcd").resolvedOptions()
|
|
.numberingSystem
|
|
);
|