File: only.t

package info (click to toggle)
libperl-prereqscanner-notquitelite-perl 0.9917-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 944 kB
  • sloc: perl: 5,239; makefile: 2
file content (36 lines) | stat: -rw-r--r-- 901 bytes parent folder | download | duplicates (3)
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
33
34
35
36
use strict;
use warnings;
use FindBin;
use lib "$FindBin::Bin/../";
use Test::More;
use t::Util;

# taken from only.pm SYNOPSIS
test('only bare => version', <<'END', {only => 0, MyModule => '0.30'});
use only MyModule => 0.30;
END

test('only bare => version spec', <<'END', {only => 0, MyModule => 0});
use only MyModule => '0.30-0.50 !0.36 0.55-', qw(:all);
END

test('only bare => version spec', <<'END', {only => 0, MyModule => 0});
use only MyModule =>
    [ '0.20-0.27', qw(f1 f2 f3 f4) ],
    [ '0.30-',     qw(:all) ];
END

test('only {}, module => version', <<'END', {only => 0, MyModule => '0.33'});
use only {versionlib => '/home/ingy/perlmods'},
    MyModule => 0.33;
END

test('only {}', <<'END', {only => 0});
use only {versionlib => '/home/ingy/perlmods'};
END

test('only qw/bare version/', <<'END', {only => 0, 'Test::More' => 0.88});
use only qw/Test::More 0.88/;
END

done_testing;