mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 11:28:11 +00:00
LibJS: Implement String.prototype.endsWith with UTF-16 code units
This commit is contained in:
parent
d2e63a641f
commit
bdbe716547
2 changed files with 25 additions and 14 deletions
|
@ -40,3 +40,11 @@ test("basic functionality", () => {
|
|||
);
|
||||
expect(s.endsWith("bar", undefined)).toBeTrue();
|
||||
});
|
||||
|
||||
test("UTF-16", () => {
|
||||
var s = "😀";
|
||||
expect(s.endsWith("😀")).toBeTrue();
|
||||
expect(s.endsWith("\ud83d")).toBeFalse();
|
||||
expect(s.endsWith("\ude00")).toBeTrue();
|
||||
expect(s.endsWith("a")).toBeFalse();
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue