The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
Origin: https://github.com/doherty/perl5i
Bug: https://github.com/schwern/perl5i/issues/218
Bug: https://github.com/schwern/perl5i/issues/219
Bug-Debian: http://bugs.debian.org/655329
Reviewed-by: gregor herrmann <gregoa@debian.org>
Last-Update: 2012-04-09


From 879a4664c556a016856975e81127535573e300e1 Mon Sep 17 00:00:00 2001
From: Mike Doherty <doherty@cs.dal.ca>
Date: Mon, 2 Apr 2012 21:59:36 -0400
Subject: [PATCH] Make one test TODO in t/utf8.t - failure caused by RT#54777

autodie (used in perl5i) causes the open pragma (used in utf8::all)
to fail to modify the default PerlIO layers. This doesn't fix the
underlying issue, it just marks the test as a known failure. Also,
don't try to delete files unless they exist.

Fixes #218
---
 t/utf8.t |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/t/utf8.t b/t/utf8.t
index d50a967..086d2ad 100644
--- a/t/utf8.t
+++ b/t/utf8.t
@@ -17,8 +17,13 @@ use Test::More;
 
     # Test the standard handles and all newly opened handles are utf8
     ok open my $test_fh, ">", "perlio_test";
-    END { unlink "perlio_test" }
-    for my $fh (*STDOUT, *STDIN, *STDERR, $test_fh) {
+    END { unlink 'perlio_test' if -e 'perlio_test' }
+    TODO: {
+        local $TODO = 'autodie clobbers IO layers';
+        my @layers = PerlIO::get_layers($test_fh);
+        ok(@layers->grep(qr/utf8/)->flatten) or diag explain { $test_fh => \@layers};
+    }
+    for my $fh (*STDOUT, *STDIN, *STDERR) {
         my @layers = PerlIO::get_layers($fh);
         ok(@layers->grep(qr/utf8/)->flatten) or diag explain { $fh => \@layers };
     }
@@ -28,7 +33,7 @@ use Test::More;
 # And off
 {
     ok open my $test_fh, ">", "perlio_test2";
-    END { unlink "perlio_test2" }
+    END { unlink 'perlio_test2' if -e 'perlio_test2' }
 
     my @layers = PerlIO::get_layers($test_fh);
     ok( !grep /utf8/, @layers ) or diag explain { $test_fh => \@layers };
-- 
1.7.9.5