Skip Menu |

This queue is for tickets about the Win32 CPAN distribution.

Report information
The Basics
Id: 103983
Status: new
Priority: 0/
Queue: Win32

People
Owner: Nobody in particular
Requestors: Stromeko [...] NexGo.DE
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.51
Fixed in: (no value)



Subject: Test Fails for GetShortPathName
GetShort PathName tests do not check if the file system the test runs on actually has short path names enabled. Consequently it fails if run from a drive where that feature is not turned on. Itz appears that only the System Drive has that feature enabled by default on most installations although it could be switched off there as well. The following patch demonstrates the issue, if run on Cygwin/Win8.1 from an extra disk the test fails. Moving the test file to the system drive, the test succeeds using the same build. A rea fix should check the file system and/or try to use the system drive (which might not be "C:", so it needs to be determined). If that's not possible the tests need to be skipped if short path names a re not available. --- origsrc/Win32-0.51/t/GetShortPathName.t 2013-11-08 21:42:25.000000000 +0100 +++ src/Win32-0.51/t/GetShortPathName.t 2015-03-08 19:46:49.706174300 +0100 @@ -2,18 +2,21 @@ use strict; use Test; use Win32; -my $path = "Long Path $$"; +my $path = "C:\\Long Path $$"; unlink($path); END { unlink $path } -plan tests => 5; +plan tests => 7; Win32::CreateFile($path); ok(-f $path); my $short = Win32::GetShortPathName($path); -ok($short, qr/^\S{1,8}(\.\S{1,3})?$/); +ok($short, qr/^C:\\\S{1,8}(\.\S{1,3})?$/); ok(-f $short); +my $long = Win32::GetLongPathName($short); +ok($long, $path); +ok(-f $long); unlink($path); ok(!-f $path);