Skip to content

Commit 63861b6

Browse files
committed
Add tests for nqp::splice.
1 parent 83b4da9 commit 63861b6

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

t/nqp/59-nqpop.t

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Test nqp::op pseudo-functions.
44

5-
plan(119);
5+
plan(121);
66

77

88
ok( nqp::add_i(5,2) == 7, 'nqp::add_i');
@@ -169,3 +169,14 @@ ok(nqp::eqat("foobar","foo", 1) == 0, "eqat with needle argument that matches");
169169
ok(nqp::eqat("foobar","bar", -3) == 1, "eqat with a negative offset argument");
170170
ok(nqp::eqat("foobar","foo", -9001) == 1, "eqat with a gigantic offset argument");
171171
ok(nqp::eqat("foobar","foobarbaz", 0) == 0, "eqat with needle argument longer than haystack");
172+
173+
{
174+
my $source := nqp::list("100", "200", "300");
175+
my $a := nqp::list("1", "2", "3");
176+
nqp::splice($a, $source, 0, 0);
177+
ok(nqp::join(",", $a) eq '100,200,300,1,2,3', "splice");
178+
179+
my $b := nqp::list("1", "2", "3", "4");
180+
nqp::splice($b, $source, 1, 2);
181+
ok(nqp::join(",", $b) eq '1,100,200,300,4', "splice");
182+
}

0 commit comments

Comments
 (0)