File: 90_MANIFEST.t

package info (click to toggle)
libimage-sane-perl 5-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 324 kB
  • sloc: perl: 2,714; ansic: 5; makefile: 3
file content (43 lines) | stat: -rw-r--r-- 999 bytes parent folder | download | duplicates (2)
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
39
40
41
42
43
use strict;
use warnings;
use English;
use Image::Sane ':all';
use Test::More;

if ( not $ENV{TEST_AUTHOR} ) {
    my $msg = 'Author test.  Set $ENV{TEST_AUTHOR} to a true value to run.';
    plan( skip_all => $msg );
}

my $git;
SKIP: {
    skip 'Need the git repository to compare the MANIFEST.', 1
      unless (
        -d '.git'
        and eval {
            $git = `git ls-tree --name-status -r HEAD | egrep -v '^\.(git|be)'`;
        }
      );

    my $manifest = `cat MANIFEST`;

    ok( $git eq $manifest, 'MANIFEST up to date' );
}

local $INPUT_RECORD_SEPARATOR = undef;
my $file = 'lib/Image/Sane.pm';
open my $fh, '<:encoding(UTF8)', $file
  or die "Error: cannot open $file\n";
my $text = <$fh>;
close $fh or die "Error: cannot close $file\n";

if ( $text =~ /=head1\s+VERSION\s+([0-9]+([.][0-9]+)?)/xsm ) {
    my $version = $1;
    is( $version, $Image::Sane::VERSION,
        'version number correctly documented' );
}
else {
    fail 'version string not found';
}

done_testing;