diff options
author | Timothy Flynn <trflynn89@pm.me> | 2021-08-26 08:30:12 -0400 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-08-27 12:32:24 +0100 |
commit | a029e3d38af5c58023f17d3ca33eb01fd7eeac18 (patch) | |
tree | 426ebe056beb5850cd3423c9e6ca2bf33b725c8b /Userland/Libraries/LibJS/Tests/builtins | |
parent | 0f02def3c2003ab9cdfae51e47f84db8e732ad5e (diff) | |
download | serenity-a029e3d38af5c58023f17d3ca33eb01fd7eeac18.zip |
LibJS: Extend Intl.DisplayNames.of to support script tags
Diffstat (limited to 'Userland/Libraries/LibJS/Tests/builtins')
-rw-r--r-- | Userland/Libraries/LibJS/Tests/builtins/Intl/DisplayNames/DisplayNames.prototype.of.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Userland/Libraries/LibJS/Tests/builtins/Intl/DisplayNames/DisplayNames.prototype.of.js b/Userland/Libraries/LibJS/Tests/builtins/Intl/DisplayNames/DisplayNames.prototype.of.js index 314ec0599c..7b2385ab2e 100644 --- a/Userland/Libraries/LibJS/Tests/builtins/Intl/DisplayNames/DisplayNames.prototype.of.js +++ b/Userland/Libraries/LibJS/Tests/builtins/Intl/DisplayNames/DisplayNames.prototype.of.js @@ -58,4 +58,19 @@ describe("correct behavior", () => { expect(es419.of("AA")).toBe("AA"); expect(zhHant.of("AA")).toBe("AA"); }); + + test("option type script", () => { + const en = new Intl.DisplayNames("en", { type: "script" }); + expect(en.of("Latn")).toBe("Latin"); + + const es419 = new Intl.DisplayNames("es-419", { type: "script" }); + expect(es419.of("Latn")).toBe("latรญn"); + + const zhHant = new Intl.DisplayNames(["zh-Hant"], { type: "script" }); + expect(zhHant.of("Latn")).toBe("ๆไธๆ"); + + expect(en.of("Aaaa")).toBe("Aaaa"); + expect(es419.of("Aaaa")).toBe("Aaaa"); + expect(zhHant.of("Aaaa")).toBe("Aaaa"); + }); }); |