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