File: coderefs_in_inc.t

package info (click to toggle)
liblocal-lib-perl 1.006005-1%2Bsqueeze1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 280 kB
  • ctags: 168
  • sloc: perl: 2,153; makefile: 17
file content (19 lines) | stat: -rw-r--r-- 437 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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';