difforig t/io/crlf.t diff -u t/io/crlf.t.orig t/io/crlf.t --- t/io/crlf.t.orig 2011-03-28 21:59:51.729376900 +0200 +++ t/io/crlf.t 2011-06-07 15:34:07.808130000 +0200 @@ -10,10 +10,10 @@ use Config; -my $file = tempfile(); +my $file = "xx"; #tempfile(); { - plan(tests => 16); + plan(tests => 20); ok(open(FOO,">:crlf",$file)); ok(print FOO 'a'.((('a' x 14).qq{\n}) x 2000) || close(FOO)); ok(open(FOO,"<:crlf",$file)); @@ -70,6 +70,22 @@ unlike($foo, qr/\x0d\x0d/); } } + + # [perl 58xxxx] 4096 bufsize edge-case: \r\n not detected + # => \r\r\n + open(FOO,">:crlf",$file); + print FOO ('.' x 4095).qq{\n}; + close(FOO); + ok (-s $file == 4097); + open(FOO,"<:crlf",$file); + + { local $/; $text = } + is(count_chars($text, "\015\012"), 0); + is(count_chars($text, "\n"), 1); + open(FOO, ">:crlf", "$file"); + print FOO $text; + close FOO; + ok (-s $file == 4097); } sub count_chars {