mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-12 02:59:45 +00:00
Everywhere: Hoist the Libraries folder to the top-level
This commit is contained in:
parent
950e819ee7
commit
93712b24bf
Notes:
github-actions[bot]
2024-11-10 11:51:52 +00:00
Author: https://github.com/trflynn89
Commit: 93712b24bf
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2256
Reviewed-by: https://github.com/sideshowbarker
4547 changed files with 104 additions and 113 deletions
42
Libraries/LibJS/Tests/builtins/String/String.js
Normal file
42
Libraries/LibJS/Tests/builtins/String/String.js
Normal file
|
@ -0,0 +1,42 @@
|
|||
test("constructor properties", () => {
|
||||
expect(String).toHaveLength(1);
|
||||
expect(String.name).toBe("String");
|
||||
});
|
||||
|
||||
test("typeof", () => {
|
||||
expect(typeof String()).toBe("string");
|
||||
expect(typeof new String()).toBe("object");
|
||||
});
|
||||
|
||||
test("length", () => {
|
||||
expect(new String().length).toBe(0);
|
||||
expect(new String("a").length).toBe(1);
|
||||
expect(new String("\u180E").length).toBe(1);
|
||||
expect(new String("\uDBFF\uDFFF").length).toBe(2);
|
||||
|
||||
// Issue #2280
|
||||
expect("⛳".length).toBe(1);
|
||||
expect("🔥".length).toBe(2);
|
||||
expect("🔥🔥🔥".length).toBe(6);
|
||||
expect("👨👩👦".length).toBe(8);
|
||||
expect("👩❤️💋👩".length).toBe(11);
|
||||
});
|
||||
|
||||
test("indices", () => {
|
||||
expect("abc"[0]).toBe("a");
|
||||
expect("abc"[1]).toBe("b");
|
||||
expect("abc"[2]).toBe("c");
|
||||
expect("abc"[3]).toBeUndefined();
|
||||
|
||||
expect("😀"[0]).toBe("\ud83d");
|
||||
expect("😀"[1]).toBe("\ude00");
|
||||
expect("😀"[2]).toBeUndefined();
|
||||
});
|
||||
|
||||
test("properties", () => {
|
||||
expect(Object.getOwnPropertyNames("")).toEqual(["length"]);
|
||||
expect(Object.getOwnPropertyNames("a")).toEqual(["0", "length"]);
|
||||
expect(Object.getOwnPropertyNames("ab")).toEqual(["0", "1", "length"]);
|
||||
expect(Object.getOwnPropertyNames("abc")).toEqual(["0", "1", "2", "length"]);
|
||||
expect(Object.getOwnPropertyNames("😀")).toEqual(["0", "1", "length"]);
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue