mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 22:57:44 +00:00
LibJS: Implement Intl.Locale.prototype.script
This commit is contained in:
parent
c3b6f43641
commit
349fd06b86
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.script;
|
||||
}).toThrowWithMessage(TypeError, "Not a Intl.Locale object");
|
||||
});
|
||||
});
|
||||
|
||||
describe("normal behavior", () => {
|
||||
test("basic functionality", () => {
|
||||
expect(new Intl.Locale("en").script).toBeUndefined();
|
||||
expect(new Intl.Locale("en-Latn").script).toBe("Latn");
|
||||
expect(new Intl.Locale("en-GB").script).toBeUndefined();
|
||||
expect(new Intl.Locale("en", { script: "Latn" }).script).toBe("Latn");
|
||||
expect(new Intl.Locale("en", { region: "GB" }).script).toBeUndefined();
|
||||
|
||||
expect(new Intl.Locale("en-u-ca-abc").script).toBeUndefined();
|
||||
expect(new Intl.Locale("en", { calendar: "abc" }).script).toBeUndefined();
|
||||
expect(new Intl.Locale("en-x-abcd").script).toBeUndefined();
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue