[Bast-commits] r7494 - local-lib/1.000/trunk/t

t0m at dev.catalyst.perl.org t0m at dev.catalyst.perl.org
Wed Sep 2 22:33:43 GMT 2009


Author: t0m
Date: 2009-09-02 22:33:42 +0000 (Wed, 02 Sep 2009)
New Revision: 7494

Added:
   local-lib/1.000/trunk/t/coderefs_in_inc.t
Log:
I totally misparsed the next if ref code first time round, oops. Here are some tests for what it does to help idiots like me in future

Added: local-lib/1.000/trunk/t/coderefs_in_inc.t
===================================================================
--- local-lib/1.000/trunk/t/coderefs_in_inc.t	                        (rev 0)
+++ local-lib/1.000/trunk/t/coderefs_in_inc.t	2009-09-02 22:33:42 UTC (rev 7494)
@@ -0,0 +1,19 @@
+use strict;
+use warnings;
+use Test::More;
+use File::Temp qw(tempdir);
+use Cwd;
+
+# Test that refs in @INC don't get mangled.
+
+plan tests => 2;
+
+my $dir = tempdir('test_local_lib-XXXXX', DIR => Cwd::abs_path('t'), CLEANUP => 1);
+
+use local::lib ();
+my $code = sub {};
+push(@INC, $code);
+local::lib->import($dir);
+ok grep({ $_ eq $code } @INC), 'Can find code ref in @INC';
+ok grep({ ref $_ } @INC), 'It really is a ref, not stringified';
+




More information about the Bast-commits mailing list