diff options
author | Nicholas Clark <nick@ccl4.org> | 2010-06-06 11:50:56 +0200 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2010-06-06 11:52:29 +0200 |
commit | 0bf6a637d180d2ff237212513f8b816d40ead86a (patch) | |
tree | 309d380a718b4b4040165a75ba633a997fca7fea | |
parent | af5c7f63b8ce18483dfeb72829f70ee387ece366 (diff) | |
download | perl-0bf6a637d180d2ff237212513f8b816d40ead86a.tar.gz |
Test the return value of push and unshift.
-rw-r--r-- | t/op/tiearray.t | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/t/op/tiearray.t b/t/op/tiearray.t index 3040ae4659..99b7938487 100644 --- a/t/op/tiearray.t +++ b/t/op/tiearray.t @@ -147,7 +147,7 @@ sub FETCHSIZE { -1 } package main; -plan(tests => 66); +plan(tests => 69); {my @ary; @@ -178,7 +178,7 @@ is(pop(@ary), 3); is($seen{'POP'}, 1); is(join(':',@ary), '1:2'); -push(@ary,4); +is(push(@ary,4), 3); is($seen{'PUSH'}, 1); is(join(':',@ary), '1:2:4'); @@ -216,10 +216,12 @@ $seen{SHIFT} = 0; shift @ary; # this didn't used to call SHIFT at all is($seen{SHIFT}, 1); $seen{PUSH} = 0; -push @ary; # this didn't used to call PUSH at all +my $got = push @ary; # this didn't used to call PUSH at all +is($got, 0); is($seen{PUSH}, 1); $seen{UNSHIFT} = 0; -unshift @ary; # this didn't used to call UNSHIFT at all +$got = unshift @ary; # this didn't used to call UNSHIFT at all +is($got, 0); is($seen{UNSHIFT}, 1); @ary = qw(3 2 1); |