diff options
Diffstat (limited to 't/io/dup.t')
-rwxr-xr-x | t/io/dup.t | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/t/io/dup.t b/t/io/dup.t index 48497fd232..0287023301 100755 --- a/t/io/dup.t +++ b/t/io/dup.t @@ -10,7 +10,7 @@ use Config; no warnings 'once'; my $test = 1; -print "1..26\n"; +print "1..29\n"; print "ok 1\n"; open(DUPOUT,">&STDOUT"); @@ -133,5 +133,25 @@ SKIP: { } close G; + use utf8; + open UTFOUT, '>:utf8', "dup$$" or die $!; + open UTFDUP, '>&UTFOUT' or die $!; + my $message = "ça marche pas\n"; + print UTFOUT $message; + print UTFDUP $message; + binmode UTFDUP, ':utf8'; + print UTFDUP $message; + close UTFOUT; + close UTFDUP; + open(UTFIN, "<:utf8", "dup$$") or die $!; + { + my $line; + $line = <UTFIN>; is($line, $message); + $line = <UTFIN>; is($line, $message); + $line = <UTFIN>; is($line, $message); + } + close UTFIN; + no utf8; + END { 1 while unlink "dup$$" } } |