Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add list_s test.
  • Loading branch information
pmurias committed Feb 14, 2015
1 parent bf84036 commit 6820384
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/vm/js/bin/run_tests
@@ -1,3 +1,3 @@
#!/bin/bash
# 19 and 30 where moved out as they were parrot specific, 52,54 is missing, we can't pass 49 till we are bootstraped
prove "$@" -e './nqp-js' t/nqp/{01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16,17,18,20,21,22,23,25,26,27,28,33,35,36,37,38,39,40,41,42,46,47,48,51,53,55,56,57,58,59,63,64,65,68,69,70,71,75,76,81,83,88,89,90,91,92,93}* t/js/getcomp-js.t t/qast/02*
prove "$@" -e './nqp-js' t/nqp/{01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16,17,18,20,21,22,23,25,26,27,28,33,35,36,37,38,39,40,41,42,46,47,48,51,53,55,56,57,58,63,64,65,68,69,70,71,75,76,81,83,88,89,90,91,92,93}* t/js/getcomp-js.t t/qast/02*
16 changes: 15 additions & 1 deletion t/nqp/59-nqpop.t
Expand Up @@ -2,7 +2,7 @@

# Test nqp::op pseudo-functions.

plan(153);
plan(158);

ok( nqp::add_i(5,2) == 7, 'nqp::add_i');
ok( nqp::sub_i(5,2) == 3, 'nqp::sub_i');
Expand Down Expand Up @@ -238,3 +238,17 @@ ok(nqp::iseq_i(11, 10) == 0, "iseq_i >");
my $b := nqp::list_i(1,2,30.4);
ok(nqp::atpos_i($b,2) == 30, 'atpos_i');
}

{
my $a := nqp::list_s();
nqp::push_s($a, "A");
nqp::push_s($a, "B");
nqp::push_s($a, "C");
ok(nqp::elems($a) == 3, 'nqp::elems/nqp::push_s');
ok(nqp::pop_s($a) eq "C", 'nqp::pop_s');
ok(nqp::elems($a) == 2, 'nqp::pop_s reduces the number of elements correctly');
ok(nqp::islist($a) == 1, 'nqp::islist(nqp::list_s())');

my $b := nqp::list_s("A","B","C");
ok(nqp::atpos_s($b,2) eq "C", 'atpos_s');
}

0 comments on commit 6820384

Please sign in to comment.