Re: [rt.cpan.org #66751] make test fails on cygwin

[email protected] (Reini Urban)
Newsgroups perl.libwin32
Message-ID <CAHiT=DHA3ST7Y1++fznufdvKcC7pJpZXFKEBZMjW1Uk_1npv0Q@mail.gmail.com>
2011/8/26 Andjelkovic Toni RBS sIT <[email protected]>:
> The test fails because readdir() on Cygwin returns a scalar containing UTF8,
> but it does not set the scalar's UTF-8 flag. It helps to set the flag
> explicitely:

Yes, on cygwin >= 1.7 only.

I skipped that test on my cygwin github branch for CORE in
cpan/Win32/t/Unicode.t

> --- t/Unicode.t.bak     2011-08-26 16:37:11.483644100 +0200
> +++ t/Unicode.t 2011-08-26 16:45:10.802566000 +0200
> @@ -1,5 +1,6 @@
>  use strict;
>  use Test;
> +use Encode;
>  use Cwd qw(cwd);
>  use Win32;
>
> @@ -48,6 +49,7 @@
>  ok(opendir(my $dh, Win32::GetANSIPathName($dir)));
>  while ($_ = readdir($dh)) {
>     next if /^\./;
> +    Encode::_utf8_on($_) if $^O eq "cygwin";
>     ok($file, Win32::GetLongPathName("$dir\\$_"));
>  }
>  closedir($dh);

-- 
Reini Urban
http://phpwiki.org/           http://murbreak.at/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.