mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:57:35 +00:00
LibJS: Implement String.prototype.charAt with UTF-16 code units
This commit is contained in:
parent
2bba20d123
commit
5d11614bc7
2 changed files with 24 additions and 4 deletions
|
@ -18,3 +18,11 @@ test("basic functionality", () => {
|
|||
expect(s.charAt("foo")).toBe("f");
|
||||
expect(s.charAt(undefined)).toBe("f");
|
||||
});
|
||||
|
||||
test("UTF-16", () => {
|
||||
var s = "😀";
|
||||
expect(s).toHaveLength(2);
|
||||
expect(s.charAt(0)).toBe("\ud83d");
|
||||
expect(s.charAt(1)).toBe("\ude00");
|
||||
expect(s.charAt(2)).toBe("");
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue