From: Nick Ing-Simmons Date: Tue, 26 Mar 2002 15:31:55 +0000 (+0000) Subject: Testcase for crlf spanning buffer boundary X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d3db65ffa00c802f9536308be8dd6c439a0d94d8;p=p5sagit%2Fp5-mst-13.2.git Testcase for crlf spanning buffer boundary p4raw-id: //depot/perlio@15521 --- diff --git a/MANIFEST b/MANIFEST index 45d613d..4834bc5 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2158,6 +2158,7 @@ t/comp/use.t See if pragmas work t/harness Finer diagnostics from test suite t/io/argv.t See if ARGV stuff works t/io/binmode.t See if binmode() works +t/io/crlf.t See if :crlf works t/io/dup.t See if >& works right t/io/fflush.t See if auto-flush on fork/exec/system/qx works t/io/fs.t See if directory manipulations work diff --git a/t/io/crlf.t b/t/io/crlf.t new file mode 100644 index 0000000..858df17 --- /dev/null +++ b/t/io/crlf.t @@ -0,0 +1,42 @@ +#!./perl -w + +BEGIN { + chdir 't' if -d 't'; + @INC = qw(. ../lib); +} + +use Config; + +require "test.pl"; + +my $file = "crlf$$.dat"; +END { + unlink($file); +} + +if ($Config{useperlio}) { + plan(tests => 6); + ok(open(FOO,">:crlf",$file)); + ok(print FOO 'a'.((('a' x 14).qq{\n}) x 2000) || close(FOO)); + ok(open(FOO,"<:crlf",$file)); + my $seen = 0; + while () + { + $seen++ if (/\r/); + } + is($seen,0); + binmode(FOO); + seek(FOO,0,0); + $seen = 0; + while () + { + $seen++ if (/\r/); + } + is($seen,2000); + ok(close(FOO)); +} +else { + skip_all("No perlio, so no :crlf"); +} + +