win32.t revision 1.1
1#!perl -w 2use strict; 3use Test::More; 4use XS::APItest; 5use Config; 6 7plan skip_all => "Tests only apply on MSWin32" 8 unless $^O eq "MSWin32"; 9 10SKIP: 11{ 12 # [perl #126755] previous the bad drive tests would crash 13 $Config{ccflags} =~ /(?:\A|\s)-DPERL_IMPLICIT_SYS\b/ 14 or skip "need implicit_sys for this test", 1; 15 eval "use Encode; 1" 16 or skip "Can't load Encode", 1; 17 for my $letter ("A" .. "Z", "a" .. "z") { 18 my $good_drive = $letter . ":"; 19 my $result = PerlDir_mapA($good_drive); 20 like($result, qr/^$letter:\\/i, "check good drive $letter"); 21 22 my $wgood_drive = encode("UTF-16LE", $good_drive . "\0"); 23 $result = PerlDir_mapW($wgood_drive); 24 like(decode("UTF16-LE", $result), qr/^$letter:\\/i, 25 "check a good drive (wide)"); 26 } 27 for my $bad ('@', '[', '!', '~', '`', '{') { 28 my $bad_drive = "$bad:"; 29 my $result = PerlDir_mapA($bad_drive); 30 is($result, $bad_drive, "check bad drive $bad:"); 31 32 my $wbad_drive = encode("UTF-16LE", $bad_drive . "\0"); 33 $result = PerlDir_mapW($wbad_drive); 34 is(decode("UTF16-LE", $result), "$bad_drive\0", 35 "check bad drive $bad: (wide)"); 36 } 37 require Win32; 38 my (undef, $major, $minor)= Win32::GetOSVersion(); 39 if ($major >= 5 && $minor >= 1) { #atleast XP, 2K only has V5 40 #this is testing the current state of things, specifically manifest stuff 41 #this test can be changed if perls relationship to comctl32.dll changes 42 my @ccver = Comctl32Version(); 43 cmp_ok($ccver[0], '>=', 6, "comctl32.dll is atleast version 6") 44 or diag "comctl32 version is (@ccver)"; 45 } 46} 47 48done_testing(); 49