Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Test popn/shiftn in scalar context.

For #149
  • Loading branch information...
commit 40c264f6809392d748f5bfb9e27040ec9e7beb10 1 parent 5f10f01
@schwern schwern authored
Showing with 16 additions and 0 deletions.
  1. +8 −0 t/popn.t
  2. +8 −0 t/shiftn.t
View
8 t/popn.t
@@ -50,4 +50,12 @@ note "popn with arg > length of array"; {
is_deeply \@newarray, \@newwant;
}
+note "popn in scalar context"; {
+ my $array = [1,2,3,4,5];
+ my $new = $array->popn(3);
+
+ is_deeply $array, [1,2];
+ is_deeply $new, [3,4,5];
+}
+
done_testing;
View
8 t/shiftn.t
@@ -51,4 +51,12 @@ note "shiftn with arg > length of array"; {
is_deeply \@newarray, \@newwant;
}
+note "shiftn in scalar context"; {
+ my $array = [1,2,3,4,5];
+ my $new = $array->shiftn(3);
+
+ is_deeply $array, [4,5];
+ is_deeply $new, [1,2,3];
+}
+
done_testing();
Please sign in to comment.
Something went wrong with that request. Please try again.