File: pmdesc.t

package info (click to toggle)
pmtools 2.2.0-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 388 kB
  • sloc: perl: 803; makefile: 10
file content (38 lines) | stat: -rw-r--r-- 778 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
37
38
# pmdesc testing

# ------ pragmas
use strict;
use warnings;
use Test::More tests => 2;

# ------ define variable
my $output_split   = undef;
my $output_unified = undef;

# ------ add pmtools to PATH for testing, so we use the current pmtools
$ENV{"PATH"} = 'blib/script:' . $ENV{"PATH"};

my $split;
my $unified;

eval {
    $output_unified = `bin/pmdesc Carp 2>&1`;
};
$unified = $?;

eval {
    $output_split = `bin/pmdesc --splitpod Carp 2>&1`;
};
$split = $?;

if ($unified == 0 || $split == 0) {
    is($?, 0, "pmdesc runs");
} else {
    fail('pmdesc fails to run');
}
if ($output_unified =~ m/Carp\D+\(\d+\.\d+\)\s-\s\w/msx
 || $output_split   =~ m/Carp\D+\(\d+\.\d+\)\s-\s\w/msx) {
    pass('described a module');
} else {
    fail('no description found by pmdesc');
}