File: coderefs_in_inc.t

package info (click to toggle)
liblocal-lib-perl 2.000019-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 344 kB
  • ctags: 81
  • sloc: perl: 928; makefile: 13
file content (18 lines) | stat: -rw-r--r-- 395 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use strict;
use warnings;
use Test::More tests => 2;
use lib 't/lib';
use TempDir;
use Cwd;

# Test that refs in @INC don't get mangled.

my $dir = mk_temp_dir('test_local_lib-XXXXX');

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';