NAME ^

t/distro/file_metadata.t - verify file metadata matches expectations

SYNOPSIS ^

 % prove t/distro/file_metadata.t

DESCRIPTION ^

Makes sure that file metadata meets our expectations. For example, checks include 'all test files have "text/plain" mime-type', and 'all "text/plain" files have keyword expansion enabled'.

Note: These tests would benefit from judicial application of Iterators.

# When unskipped, rewrite to use get_attribute()...

SKIP: { skip 'custom svn keywords not yet supported' => 1; ## Copyright keyword COPYRIGHT: { my $readme = catfile( $PConfig{build_dir}, 'README' ); open my $IN, '<' => $readme or die qq|can't open $readme: $!|;

    my $official_copyright;
    while( <$IN> )
    {
        next unless m/^Parrot is (Copyright .*)/;
        $official_copyright = $1;
        last;
    }
    fail('official copyright not found') and last COPYRIGHT
        unless length $official_copyright;

    @cmd = qw(pg Copyright);

    $msg = 'Copyright property matches official copyright';
    diag $msg;

    is(
        sub{ my $r = qx($cmd @cmd $_); chomp $r; "$_: $r" }->(),
        "$_: $official_copyright",
        "$msg ($_)"
    ) for @manifest_files;
} # COPYRIGHT
} # SKIP


parrot