82dee7de92a0bd35 failed to add ext/lib/Makefile.PL. Oops.
[p5sagit/p5-mst-13.2.git] / ext / ExtUtils-MakeMaker / t / fix_libs.t
1 #!/usr/bin/perl -w
2
3 # Unit test the code which fixes up $self->{LIBS}
4
5 BEGIN {
6     chdir 't' if -d 't';
7 }
8
9 use strict;
10 use lib './lib';
11 use Test::More 'no_plan';
12
13 use ExtUtils::MakeMaker;
14
15 my @tests = (
16         # arg           # want
17     [   undef,          ['']    ],
18     [   "foo",          ['foo'] ],
19     [   [],             ['']    ],
20     [   ["foo"],        ['foo'] ],
21     [   [1, 2, 3],      [1, 2, 3] ],
22     [   [0],            [0]     ],
23     [   [''],           ['']    ],
24     [   "  ",           ['  ']  ],
25 );
26
27 for my $test (@tests) {
28     my($arg, $want) = @$test;
29
30     my $display = defined $arg ? $arg : "undef";
31     is_deeply( MM->_fix_libs($arg), $want, "fix_libs($display)" );
32 }