Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add more nqp:: list/iterator tests.
  • Loading branch information
pmichaud committed Jun 22, 2011
1 parent ba48021 commit be6433c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions t/nqp/59-nqpop.t
Expand Up @@ -2,7 +2,7 @@

# Test nqp::op pseudo-functions.

plan(64);
plan(71);


ok( nqp::add_i(5,2) == 7, 'nqp::add_i');
Expand Down Expand Up @@ -87,4 +87,12 @@ my $list := nqp::list(0, 'a', 'b', 3.0);
ok( nqp::elems($list) == 4, 'nqp::elems');
ok( nqp::atpos($list, 0) == 0, 'nqp::atpos');
ok( nqp::atpos($list, 2) eq 'b', 'nqp::atpos');

nqp::push($list, 'four');
ok( nqp::elems($list) == 5, 'nqp::push');
ok( nqp::shift($list) == 0, 'nqp::shift');
ok( nqp::pop($list) eq 'four', 'nqp::pop');
my $iter := nqp::iterator($list);
ok( nqp::shift($iter) eq 'a', 'nqp::iterator');
ok( nqp::shift($iter) eq 'b', 'nqp::iterator');
ok( nqp::shift($iter) == 3.0, 'nqp::iterator');
ok( nqp::elems($list) == 3, "iterator doesn't modify list");

0 comments on commit be6433c

Please sign in to comment.