mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 20:29:18 +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
30
Libraries/LibJS/Tests/string-concatenation.js
Normal file
30
Libraries/LibJS/Tests/string-concatenation.js
Normal file
|
@ -0,0 +1,30 @@
|
|||
test("adding strings", () => {
|
||||
expect("" + "").toBe("");
|
||||
expect("ab" + "").toBe("ab");
|
||||
expect("" + "cd").toBe("cd");
|
||||
expect("ab" + "cd").toBe("abcd");
|
||||
});
|
||||
|
||||
test("adding strings with non-strings", () => {
|
||||
expect("a" + 1).toBe("a1");
|
||||
expect(1 + "a").toBe("1a");
|
||||
expect("a" + {}).toBe("a[object Object]");
|
||||
expect({} + "a").toBeNaN();
|
||||
expect("a" + []).toBe("a");
|
||||
expect([] + "a").toBe("a");
|
||||
expect("a" + NaN).toBe("aNaN");
|
||||
expect(NaN + "a").toBe("NaNa");
|
||||
expect(Array(16).join([[][[]] + []][+[]][++[+[]][+[]]] - 1) + " Batman!").toBe(
|
||||
"NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN Batman!"
|
||||
);
|
||||
});
|
||||
|
||||
test("adding strings with dangling surrogates", () => {
|
||||
expect("\ud834" + "").toBe("\ud834");
|
||||
expect("" + "\udf06").toBe("\udf06");
|
||||
expect("\ud834" + "\udf06").toBe("𝌆");
|
||||
expect("\ud834" + "\ud834").toBe("\ud834\ud834");
|
||||
expect("\udf06" + "\udf06").toBe("\udf06\udf06");
|
||||
expect("\ud834a" + "\udf06").toBe("\ud834a\udf06");
|
||||
expect("\ud834" + "a\udf06").toBe("\ud834a\udf06");
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue