Skip to content

Commit be6433c

Browse files
committed
Add more nqp:: list/iterator tests.
1 parent ba48021 commit be6433c

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

t/nqp/59-nqpop.t

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

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

5-
plan(64);
5+
plan(71);
66

77

88
ok( nqp::add_i(5,2) == 7, 'nqp::add_i');
@@ -87,4 +87,12 @@ my $list := nqp::list(0, 'a', 'b', 3.0);
8787
ok( nqp::elems($list) == 4, 'nqp::elems');
8888
ok( nqp::atpos($list, 0) == 0, 'nqp::atpos');
8989
ok( nqp::atpos($list, 2) eq 'b', 'nqp::atpos');
90-
90+
nqp::push($list, 'four');
91+
ok( nqp::elems($list) == 5, 'nqp::push');
92+
ok( nqp::shift($list) == 0, 'nqp::shift');
93+
ok( nqp::pop($list) eq 'four', 'nqp::pop');
94+
my $iter := nqp::iterator($list);
95+
ok( nqp::shift($iter) eq 'a', 'nqp::iterator');
96+
ok( nqp::shift($iter) eq 'b', 'nqp::iterator');
97+
ok( nqp::shift($iter) == 3.0, 'nqp::iterator');
98+
ok( nqp::elems($list) == 3, "iterator doesn't modify list");

0 commit comments

Comments
 (0)