summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/t/fix_libs.t
blob: 0ca8ffbb85a48cd8b876eb247e5409fd5b016a63 (plain) (blame)
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
#!/usr/bin/perl -w

# Unit test the code which fixes up $self->{LIBS}

BEGIN {
    chdir 't' if -d 't';
}

use strict;
use lib './lib';
use Test::More 'no_plan';

use ExtUtils::MakeMaker;

my @tests = (
        # arg           # want
    [   undef,          ['']    ],
    [   "foo",          ['foo'] ],
    [   [],             ['']    ],
    [   ["foo"],        ['foo'] ],
    [   [1, 2, 3],      [1, 2, 3] ],
    [   [0],            [0]     ],
    [   [''],           ['']    ],
    [   "  ",           ['  ']  ],
);

for my $test (@tests) {
    my($arg, $want) = @$test;

    my $display = defined $arg ? $arg : "undef";
    is_deeply( MM->_fix_libs($arg), $want, "fix_libs($display)" );
}