#!./perl -w
BEGIN {
chdir
't'
;
@INC
=
'../lib'
;
}
require
'./test.pl'
;
my
$manifest
=
'../MANIFEST'
;
open
my
$m
,
'<'
,
$manifest
or
die
"Can't open '$manifest': $!"
;
my
@files
;
while
(<
$m
>) {
chomp
;
my
(
$path
) =
split
/\t+/;
push
@files
,
$path
;
}
close
$m
or
die
$!;
plan(
scalar
@files
);
PATHNAME:
for
my
$pathname
(
@files
) {
my
@path_components
=
split
(
'/'
,
$pathname
);
my
$filename
=
pop
@path_components
;
for
my
$component
(
@path_components
) {
if
(
$component
=~ /\./) {
fail(
"$pathname has directory components containing '.'"
);
next
PATHNAME;
}
if
(
length
$component
> 32) {
fail(
"$pathname has a name over 32 characters (VOS requirement)"
);
next
PATHNAME;
}
}
if
(
$filename
=~ /^\-/) {
fail(
"$pathname starts with -"
);
next
PATHNAME;
}
my
(
$before
,
$after
) =
split
/\./,
$filename
;
if
(
length
$before
> 39) {
fail(
"$pathname has more than 39 characters before the dot"
);
}
elsif
(
$after
&&
length
$after
> 39) {
fail(
"$pathname has more than 39 characters after the dot"
);
}
elsif
(
$filename
=~ /^(?:CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9])\./i) {
fail(
"$pathname has a reserved name"
);
}
elsif
(
$filename
=~ /\s|\(|\&/) {
fail(
"$pathname has a reserved character"
);
}
else
{
pass(
"$pathname ok"
);
}
}