02c480ebb0aa1dca62a624e3478a93f75100f6a8
[p5sagit/local-lib.git] / t / coderefs_in_inc.t
1 use strict;
2 use warnings;
3 use Test::More;
4 use File::Temp qw(tempdir);
5 use Cwd;
6
7 # Test that refs in @INC don't get mangled.
8
9 plan tests => 2;
10
11 my $dir = tempdir('test_local_lib-XXXXX', DIR => Cwd::abs_path('t'), CLEANUP => 1);
12
13 use local::lib ();
14 my $code = sub {};
15 push(@INC, $code);
16 local::lib->import($dir);
17 ok grep({ $_ eq $code } @INC), 'Can find code ref in @INC';
18 ok grep({ ref $_ } @INC), 'It really is a ref, not stringified';
19