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