xref: /openbsd-src/gnu/usr.bin/perl/cpan/Win32/t/GetShortPathName.t (revision f2da64fbbbf1b03f09f390ab01267c93dfd77c4c)
1use strict;
2use Test;
3use Win32;
4
5my $path = "Long Path $$";
6unlink($path);
7END { unlink $path }
8
9plan tests => 5;
10
11Win32::CreateFile($path);
12ok(-f $path);
13
14my $short = Win32::GetShortPathName($path);
15ok($short, qr/^\S{1,8}(\.\S{1,3})?$/);
16ok(-f $short);
17
18unlink($path);
19ok(!-f $path);
20ok(!defined Win32::GetShortPathName($path));
21