File: 04-export-nouse-base.t

package info (click to toggle)
libfindbin-libs-perl 4.0.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 704 kB
  • sloc: perl: 1,323; sh: 38; makefile: 7
file content (70 lines) | stat: -rw-r--r-- 1,270 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
package Testophile;

use v5.8;

use Test::More;

use Cwd         qw( abs_path        );
use List::Util  qw( first           );
use Symbol      qw( qualify_to_ref  );

$\ = "\n";
$, = "\n\t";

# note: /bin does not exist on W32 systems. need to 
# attempt adding it here in order to have something
# to find at all.
#
# likely case is that adding it to the the current
# directory is likely to work.

my @basz    = qw( bin lib );

plan tests => 2 * @basz;

require FindBin::libs;

for my $base ( @basz )
{
    my $dir = "/$base";

    SKIP:
    {
        -e $dir
        or skip "System lacks '$dir' directory" => 2;

        eval
        {
            FindBin::libs->import
            (
                "base=$base", 
                qw
                (
                    noprint
                    export
                    nouse
                    noignore
                )
            );

            1
        }
        or skip "Failed search: '$base', $@" => 2;

        my $expect  = abs_path $dir;
        my $ref     = qualify_to_ref $base;

        ok @{ *$ref }, "Installed $ref";

        first { $_ eq $expect } @{ *$ref }
        ? pass "Found '$expect' (/lib)"
        : fail "Missing: '/lib'"
        ;
    }
}

# this is not a module

0

__END__