mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-08 10:36:02 +00:00
LibJS+LibUnicode: Implement retrieval of collator keyword values
Completely missed this when implementing Intl.Collator!
This commit is contained in:
parent
422d72e85d
commit
f091047159
Notes:
github-actions[bot]
2025-06-02 21:04:47 +00:00
Author: https://github.com/trflynn89
Commit: f091047159
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4970
3 changed files with 51 additions and 9 deletions
|
@ -54,12 +54,21 @@ describe("correct behavior", () => {
|
|||
});
|
||||
|
||||
test("collation", () => {
|
||||
// Only "default" collation is parsed for now.
|
||||
const en = new Intl.Collator("en");
|
||||
expect(en.resolvedOptions().collation).toBe("default");
|
||||
const en1 = new Intl.Collator("en");
|
||||
expect(en1.resolvedOptions().locale).toBe("en");
|
||||
expect(en1.resolvedOptions().collation).toBe("default");
|
||||
|
||||
const en2 = new Intl.Collator("en-u-co-phonebk", { collation: "pinyin" });
|
||||
expect(en2.resolvedOptions().locale).toBe("en");
|
||||
expect(en2.resolvedOptions().collation).toBe("default");
|
||||
|
||||
const el = new Intl.Collator("el", { collation: "foo" });
|
||||
expect(el.resolvedOptions().locale).toBe("el");
|
||||
expect(el.resolvedOptions().collation).toBe("default");
|
||||
|
||||
const de = new Intl.Collator("de-u-co-phonebk", { collation: "pinyin" });
|
||||
expect(de.resolvedOptions().locale).toBe("de-u-co-phonebk");
|
||||
expect(de.resolvedOptions().collation).toBe("phonebk");
|
||||
});
|
||||
|
||||
test("numeric may be set by locale extension", () => {
|
||||
|
|
|
@ -26,7 +26,7 @@ describe("normal behavior", () => {
|
|||
const values = Intl.supportedValuesOf("collation");
|
||||
expect(isSorted(values)).toBeTrue();
|
||||
|
||||
expect(values.indexOf("default")).not.toBe(-1);
|
||||
expect(values.indexOf("emoji")).not.toBe(-1);
|
||||
});
|
||||
|
||||
test("currency", () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue