From aa86db36e6778689f4a9d13c9af25e2020f46bf4 Mon Sep 17 00:00:00 2001 From: Steve Hay Date: Sun, 13 Oct 2013 17:47:05 +0100 Subject: [PATCH] Fix autouse test, failing since commit 52102bb4f9 Only running test_porting and the tests of the module upgraded clearly isn't always enough :-/ --- dist/autouse/t/autouse.t | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/dist/autouse/t/autouse.t b/dist/autouse/t/autouse.t index 786a8a9..5993994 100644 --- a/dist/autouse/t/autouse.t +++ b/dist/autouse/t/autouse.t @@ -13,24 +13,24 @@ use Test::More tests => 15; BEGIN { require autouse; eval { - "autouse"->import('List::Util' => 'List::Util::first(&@)'); + "autouse"->import('Scalar::Util' => 'Scalar::Util::set_prototype(&$)'); }; ok( !$@ ); eval { - "autouse"->import('List::Util' => 'Foo::min'); + "autouse"->import('Scalar::Util' => 'Foo::min'); }; ok( $@, qr/^autouse into different package attempted/ ); - "autouse"->import('List::Util' => qw(max first(&@))); + "autouse"->import('Scalar::Util' => qw(isdual set_prototype(&$))); } -my @a = (1,2,3,4,5.5); -is( max(@a), 5.5); +ok( isdual($!) ); -# first() has a prototype of &@. Make sure that's preserved. -is( (first { $_ > 3 } @a), 4); +# set_prototype() has a prototype of &$. Make sure that's preserved. +sub sum { return $_[0] + $_[1] }; +is( (set_prototype \&sum, '$$'), \&sum); # Example from the docs. -- 1.8.3.1