File: 02-export-base.t

package info (click to toggle)
libfindbin-libs-perl 1.64-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 180 kB
  • sloc: perl: 389; makefile: 2
file content (42 lines) | stat: -rw-r--r-- 1,088 bytes parent folder | download
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
#!/usr/bin/perl

package Testophile;

use v5.8;

no warnings;    # avoid extraneous nastygrams about qw

use Test::More tests => 5;

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

# export @lib after looking for */lib
# export @found after looking for */blib
# export @binz after looking for */bin, override the 
# "ignore" to search /bin, /usr/bin.
#
# eval necessary for crippled O/S w/ missing/broken symlinks.

BEGIN
{
    eval { symlink qw( /nonexistant/path/to/foobar ./foobar ) }
}

use FindBin::libs qw( export                                            );
use FindBin::libs qw( export=found base=lib                             );
use FindBin::libs qw( export=binz  base=bin            ignore=/foo,/bar );
use FindBin::libs qw( export=junk  base=frobnicatorium                  );
use FindBin::libs qw( export       base=foobar                          );

# clean up temp files on the way out.

unlink './foobar';

ok  @lib,     '@lib exported';
ok  @found,   '@found exported';
ok  @binz,    '@binz exported';
ok ! @junk,    'empty @junk exported';
ok ! @foobar,  'empty @foobar exported';

exit 0;