mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 15:07:45 +00:00
LibJS: Implement Intl.Locale.prototype.baseName
This commit is contained in:
parent
27fc3cfe75
commit
21b3c5edba
4 changed files with 44 additions and 0 deletions
|
@ -0,0 +1,21 @@
|
|||
describe("errors", () => {
|
||||
test("called on non-Locale object", () => {
|
||||
expect(() => {
|
||||
Intl.Locale.prototype.baseName;
|
||||
}).toThrowWithMessage(TypeError, "Not a Intl.Locale object");
|
||||
});
|
||||
});
|
||||
|
||||
describe("normal behavior", () => {
|
||||
test("basic functionality", () => {
|
||||
expect(new Intl.Locale("en").baseName).toBe("en");
|
||||
expect(new Intl.Locale("en-Latn").baseName).toBe("en-Latn");
|
||||
expect(new Intl.Locale("en-GB").baseName).toBe("en-GB");
|
||||
expect(new Intl.Locale("en", { script: "Latn" }).baseName).toBe("en-Latn");
|
||||
expect(new Intl.Locale("en", { region: "GB" }).baseName).toBe("en-GB");
|
||||
|
||||
expect(new Intl.Locale("en-u-ca-abc").baseName).toBe("en");
|
||||
expect(new Intl.Locale("en", { calendar: "abc" }).baseName).toBe("en");
|
||||
expect(new Intl.Locale("en-x-abcd").baseName).toBe("en");
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue