summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/perl/t/io/crlf.t
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/usr.bin/perl/t/io/crlf.t')
-rw-r--r--gnu/usr.bin/perl/t/io/crlf.t17
1 files changed, 16 insertions, 1 deletions
diff --git a/gnu/usr.bin/perl/t/io/crlf.t b/gnu/usr.bin/perl/t/io/crlf.t
index 7fb4c1e4a82..d0275af9a0f 100644
--- a/gnu/usr.bin/perl/t/io/crlf.t
+++ b/gnu/usr.bin/perl/t/io/crlf.t
@@ -18,7 +18,7 @@ my $crcr = uni_to_native("\x0d\x0d");
my $ungetc_count = 8200; # Somewhat over the likely buffer size
{
- plan(tests => 16 + 2 * $ungetc_count);
+ plan(tests => 21 + 2 * $ungetc_count);
ok(open(FOO,">:crlf",$file));
ok(print FOO 'a'.((('a' x 14).qq{\n}) x 2000) || close(FOO));
ok(open(FOO,"<:crlf",$file));
@@ -87,6 +87,21 @@ my $ungetc_count = 8200; # Somewhat over the likely buffer size
unlike($foo, qr/$crcr/);
}
}
+
+ {
+ # check binmode removes :utf8
+ # 133604 - on Win32 :crlf is the base buffer layer, so
+ # binmode doesn't remove it, but the binmode handler didn't
+ # remove :utf8 either
+ ok(open(my $fh, ">", $file), "open a file");
+ ok(binmode($fh, ":utf8"), "add :utf8");
+ ok((() = grep($_ eq "utf8", PerlIO::get_layers($fh))),
+ "check :utf8 set");
+ ok(binmode($fh), "remove :utf8");
+ ok(!(() = grep($_ eq "utf8", PerlIO::get_layers($fh))),
+ "check :utf8 removed");
+ close $fh;
+ }
}
sub count_chars {