/usr/share/perl5/Code/TidyAll/t/Zglob.pm is in libcode-tidyall-perl 0.20-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | package Code::TidyAll::t::Zglob;
$Code::TidyAll::t::Zglob::VERSION = '0.20';
use File::Zglob;
use Test::Class::Most parent => 'Code::TidyAll::Test::Class';
use Code::TidyAll::Util::Zglob qw(zglob_to_regex);
sub test_match : Tests {
my ( $zglob, $regex );
$zglob = "**/*.txt";
$regex = zglob_to_regex($zglob);
foreach my $path (qw(foo.txt foo/baz.txt foo/bar/baz.txt)) {
like( $path, $regex, "$path matches $zglob" );
}
foreach my $path (qw(foo/bar/baz.tx)) {
unlike( $path, $regex, "$path does not match $zglob" );
}
$zglob = "**/*";
$regex = zglob_to_regex($zglob);
foreach my $path (qw(foo foo.txt foo/bar foo/baz.txt)) {
like( $path, $regex, "$path matches $zglob" );
}
$zglob = "foo/**/*.txt";
$regex = zglob_to_regex($zglob);
foreach my $path (qw(foo/baz.txt foo/bar/baz.txt foo/bar/baz/blargh.txt)) {
like( $path, $regex, "$path matches $zglob" );
}
foreach my $path (qw(foo.txt foo/bar/baz.tx)) {
unlike( $path, $regex, "$path does not match $zglob" );
}
}
1;
|