Commit | Line | Data |
c0956255 |
1 | #!/usr/bin/perl -w |
2 | |
3 | # Unit test the code which fixes up $self->{LIBS} |
4 | |
d00e3d8a |
5 | BEGIN { |
6 | chdir 't' if -d 't'; |
7 | |
8 | if( $ENV{PERL_CORE} ) { |
9 | @INC = '../lib'; |
10 | } |
11 | } |
12 | |
c0956255 |
13 | use strict; |
d00e3d8a |
14 | use lib './lib'; |
c0956255 |
15 | use Test::More 'no_plan'; |
16 | |
17 | use ExtUtils::MakeMaker; |
18 | |
19 | my @tests = ( |
20 | # arg # want |
21 | [ undef, [''] ], |
22 | [ "foo", ['foo'] ], |
23 | [ [], [''] ], |
24 | [ ["foo"], ['foo'] ], |
25 | [ [1, 2, 3], [1, 2, 3] ], |
26 | [ [0], [0] ], |
27 | [ [''], [''] ], |
28 | [ " ", [' '] ], |
29 | ); |
30 | |
31 | for my $test (@tests) { |
32 | my($arg, $want) = @$test; |
33 | |
34 | my $display = defined $arg ? $arg : "undef"; |
35 | is_deeply( MM->_fix_libs($arg), $want, "fix_libs($display)" ); |
36 | } |