File: subroutine-in-inc.t

package info (click to toggle)
liblocal-lib-perl 2.000014-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 308 kB
  • ctags: 72
  • sloc: perl: 727; makefile: 22
file content (24 lines) | stat: -rw-r--r-- 421 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
20
21
22
23
24
use strict;
use warnings FATAL => 'all';

use Test::More tests => 1;

use File::Spec;
use Cwd;
use lib 't/lib'; use TempDir;
use local::lib ();

sub CODE_in_INC() {
    return scalar grep { ref eq 'CODE' } @INC;
}

my $dir = mk_temp_dir('sub-in-INC-XXXXX');

my $base = CODE_in_INC;
unshift @INC, sub { () };
splice @INC, 3, 1, sub { () };
push @INC, sub { () };

local::lib->import($dir);

is( CODE_in_INC, $base + 3 );