Skip to content
Browse files

Merge branch 'master' of github.com:scrottie/autobox-Core

  • Loading branch information...
2 parents 33e3d90 + c819f6a commit 1864ea3b08827a597b91ba8b74a634a8809c8155 @scrottie committed Mar 18, 2010
Showing with 13 additions and 3 deletions.
  1. +13 −0 t/last_index.t
  2. +0 −3 t/tail.t
View
13 t/last_index.t
@@ -0,0 +1,13 @@
+#!/usr/bin/env perl
+
+use autobox::Core;
+use Test::More;
+
+my @numbers = ( 1 .. 10 );
+
+is( @numbers->last_index, 9 );
+is( @numbers->last_index( sub { $_[0] > 2 } ), 9 );
+
+is( @numbers->last_index( qr/^1/ ), 9 );
+
+done_testing();
View
3 t/tail.t
@@ -2,7 +2,6 @@
use strict;
use warnings;
use Test::More;
-use Test::Exception;
use autobox::Core;
my @array = qw(foo bar baz);
@@ -14,8 +13,6 @@ is_deeply [@array->tail(1)], ['baz'];
is_deeply [@array->tail(2)], ['bar', 'baz'];
is_deeply [@array->tail(3)], ['foo', 'bar', 'baz'];
-throws_ok { @array->tail(4) } qr/^Not enough elements/;
-
my @tail = @array->tail;
is scalar @tail, 2, "Returns a list in list context";

0 comments on commit 1864ea3

Please sign in to comment.
Something went wrong with that request. Please try again.