File: n1_modules_required.t

package info (click to toggle)
libmodule-info-perl 0.39-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 296 kB
  • sloc: perl: 2,202; makefile: 8
file content (24 lines) | stat: -rw-r--r-- 651 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
#!/usr/bin/perl -w

use strict;
use lib './t/lib';
use Test::More tests => 3;
use lib '.';
use Module::Info;

my $bar = Module::Info->new_from_module( 'Bar' );

SKIP: {
    skip "Only works on 5.6.1 and up.", 3 unless $] >= 5.006001;

    my %mods = $bar->modules_required;
    delete $mods{Win32} if $^O eq 'MSWin32';
    is_deeply( [ sort keys %mods ], [ sort qw(Cwd strict Carp) ],
               "Got the correct modules" );

    is_deeply( [ sort @{$mods{Cwd}} ], [ sort qw(1 1.00102 v1.1.2) ],
               "Got the correct versions when specified" );

    is_deeply( [], $mods{strict},
               "Got no version when not specified" );
}