From: t0m Date: Wed, 2 Sep 2009 22:33:42 +0000 (+0000) Subject: I totally misparsed the next if ref code first time round, oops. Here are some tests... X-Git-Tag: 1.006009~64 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2Flocal-lib.git;a=commitdiff_plain;h=2b12c1b8770136fdf70e95ea09ae137aa1d7b799 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 git-svn-id: http://dev.catalyst.perl.org/repos/bast/local-lib/1.000/trunk@7494 bd8105ee-0ff8-0310-8827-fb3f25b6796d --- diff --git a/t/coderefs_in_inc.t b/t/coderefs_in_inc.t new file mode 100644 index 0000000..02c480e --- /dev/null +++ b/t/coderefs_in_inc.t @@ -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'; +