Skip to content

Commit

Permalink
niecza fudge
Browse files Browse the repository at this point in the history
  • Loading branch information
coke committed Dec 24, 2011
1 parent 03b1456 commit 004612d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion S32-array/pop.t
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ plan 33;

is(+@pop, 0, 'we have no more element in the array');
ok(!defined(pop(@pop)), 'after the array is exhausted pop() returns undefined');
#?niecza skip 'undeclared name Failure'
ok(pop(@pop) ~~ Failure, 'after the array is exhausted pop() returns Failure');
}
}
Expand All @@ -59,21 +60,23 @@ plan 33;

is(+@pop, 0, 'we have no more element in the array');
ok(!defined(pop(@pop)), 'after the array is exhausted pop() returns undefined');
#?niecza skip 'undeclared name Failure'
ok(pop(@pop) ~~ Failure, 'after the array is exhausted pop() returns Failure');
}

# invocant syntax with inline arrays
{
is([1, 2, 3].pop, 3, 'this will return 3');
ok(!defined([].pop), 'this will return undefined');
#?niecza skip 'undeclared name Failure'
ok( [].pop ~~ Failure, '[].pop is a Failure' );
}

# some edge cases

{
my @pop;
ok(!defined(@pop.pop()), 'pop on an un-initialized array returns undefined');
#?niecza skip 'undeclared name Failure'
ok( @pop.pop() ~~ Failure, 'pop off uninitialized array is a Failure' );
}

Expand Down

0 comments on commit 004612d

Please sign in to comment.