diff options
author | Jesse Vincent <jesse@bestpractical.com> | 2011-01-04 01:24:05 +0800 |
---|---|---|
committer | Jesse Vincent <jesse@bestpractical.com> | 2011-01-04 01:25:07 +0800 |
commit | 43922be28394e54c144181f90742ee90aa83f8e1 (patch) | |
tree | 65539c6c5d6a00cade2e22ee8b69cb073f7c3481 /t | |
parent | c4ac9b44187717c7530f3bc3c6329b26e61c1f0b (diff) | |
download | perl-43922be28394e54c144181f90742ee90aa83f8e1.tar.gz |
update t/porting/filenames.t to check for path components contaning two
"." characters or with lenghts exceeding 32 characters.
Diffstat (limited to 't')
-rw-r--r-- | t/porting/filenames.t | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/t/porting/filenames.t b/t/porting/filenames.t index 07232c4b3d..67dc89ab24 100644 --- a/t/porting/filenames.t +++ b/t/porting/filenames.t @@ -52,6 +52,21 @@ sub validate_file_name { my $path = shift; my $filename = basename $path; + + my @path_components = split('/',$path); + pop @path_components; # throw away the filename + for my $component (@path_components) { + if ($component =~ /\..*?\./) { + fail("$path has a directory component containing more than one '.'"); + return; + } + + if (length($component) > 32) { + fail("$path has a directory with a name over 32 characters. This fails on VOS"); + } + } + + if ($filename =~ m/^\-/) { fail("starts with -: $path"); return; @@ -81,7 +96,7 @@ sub validate_file_name { } } - ok($filename, $filename); + ok($filename, $path); } # EOF |