mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-12 19:19:30 +00:00
LibJS: Add notation to Intl.PluralRules
This is a normative change in the ECMA-402 spec. See:
a7ff535
This commit is contained in:
parent
b16f34767e
commit
8e5cc74eb1
Notes:
github-actions[bot]
2025-05-27 14:40:25 +00:00
Author: https://github.com/trflynn89
Commit: 8e5cc74eb1
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4894
9 changed files with 101 additions and 29 deletions
|
@ -117,6 +117,12 @@ describe("errors", () => {
|
|||
}).toThrowWithMessage(RangeError, "Value 22 is NaN or is not between 1 and 21");
|
||||
});
|
||||
|
||||
test("notation option is invalid ", () => {
|
||||
expect(() => {
|
||||
new Intl.PluralRules("en", { notation: "hello!" });
|
||||
}).toThrowWithMessage(RangeError, "hello! is not a valid value for option notation");
|
||||
});
|
||||
|
||||
test("roundingPriority option is invalid", () => {
|
||||
expect(() => {
|
||||
new Intl.PluralRules("en", { roundingPriority: "hello!" });
|
||||
|
@ -239,6 +245,14 @@ describe("normal behavior", () => {
|
|||
}
|
||||
});
|
||||
|
||||
test("all valid notation options", () => {
|
||||
["standard", "scientific", "engineering", "compact"].forEach(notation => {
|
||||
expect(() => {
|
||||
new Intl.PluralRules("en", { notation: notation });
|
||||
}).not.toThrow();
|
||||
});
|
||||
});
|
||||
|
||||
test("all valid roundingPriority options", () => {
|
||||
["auto", "morePrecision", "lessPrecision"].forEach(roundingPriority => {
|
||||
expect(() => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue