This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix autouse test, failing since commit 52102bb4f9
authorSteve Hay <steve.m.hay@googlemail.com>
Sun, 13 Oct 2013 16:47:05 +0000 (17:47 +0100)
committerSteve Hay <steve.m.hay@googlemail.com>
Sun, 13 Oct 2013 16:47:05 +0000 (17:47 +0100)
Only running test_porting and the tests of the module upgraded clearly
isn't always enough :-/

dist/autouse/t/autouse.t

index 786a8a9..5993994 100644 (file)
@@ -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.