upgrade to ExtUtils::MakeMaker 6.53_03
[p5sagit/p5-mst-13.2.git] / lib / ExtUtils / t / installed_file.t
1 #!/usr/bin/perl -w
2
3 # Test MM->_installed_file_for_module()
4
5 use strict;
6 use warnings;
7
8 use lib 't/lib';
9 use ExtUtils::MakeMaker;
10 use Test::More;
11 use File::Spec;
12
13
14 sub path_is {
15     my($have, $want, $name) = @_;
16
17     $have = File::Spec->canonpath($have);
18     $want = File::Spec->canonpath($want);
19
20     my $builder = Test::More->builder;
21     return $builder->is_eq( $have, $want, $name );
22 }
23
24 # Test when a module is not installed
25 {
26     ok !MM->_installed_file_for_module("aaldkfjaldj"), "Module not installed";
27     ok !MM->_installed_file_for_module("aaldkfjaldj::dlajldkj");
28 }
29
30 # Try a single name module
31 {
32     my $want = $INC{'strict.pm'};
33     path_is( MM->_installed_file_for_module("strict"), $want,  "single name module" );
34 }
35
36 # And a tuple
37 {
38     my $want = $INC{"Test/More.pm"};
39     path_is( MM->_installed_file_for_module("Test::More"), $want, "Foo::Bar style" );
40 }
41
42
43 done_testing(4);