mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 06:17:35 +00:00
LibJS/Tests: Test splice at non zero index
This commit is contained in:
parent
60750d864e
commit
d4d7550588
1 changed files with 5 additions and 0 deletions
|
@ -46,6 +46,11 @@ test("basic functionality", () => {
|
||||||
removed = array.splice(-123, 123);
|
removed = array.splice(-123, 123);
|
||||||
expect(array).toEqual([]);
|
expect(array).toEqual([]);
|
||||||
expect(removed).toEqual(["foo", "bar", "baz"]);
|
expect(removed).toEqual(["foo", "bar", "baz"]);
|
||||||
|
|
||||||
|
array = ["foo", "bar"];
|
||||||
|
removed = array.splice(1, 1, "baz");
|
||||||
|
expect(array).toEqual(["foo", "baz"]);
|
||||||
|
expect(removed).toEqual(["bar"]);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("Invalid lengths", () => {
|
test("Invalid lengths", () => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue