diff options
author | Nick Ing-Simmons <nik@tiuk.ti.com> | 2002-03-26 15:31:55 +0000 |
---|---|---|
committer | Nick Ing-Simmons <nik@tiuk.ti.com> | 2002-03-26 15:31:55 +0000 |
commit | d3db65ffa00c802f9536308be8dd6c439a0d94d8 (patch) | |
tree | cdf5a07f0ff67b0285352d1fca9b9e08336b904b /t | |
parent | 23b3c6afbc19427431935e4c7758d215f61faf41 (diff) | |
download | perl-d3db65ffa00c802f9536308be8dd6c439a0d94d8.tar.gz |
Testcase for crlf spanning buffer boundary
p4raw-id: //depot/perlio@15521
Diffstat (limited to 't')
-rw-r--r-- | t/io/crlf.t | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/t/io/crlf.t b/t/io/crlf.t new file mode 100644 index 0000000000..858df17146 --- /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 (<FOO>) + { + $seen++ if (/\r/); + } + is($seen,0); + binmode(FOO); + seek(FOO,0,0); + $seen = 0; + while (<FOO>) + { + $seen++ if (/\r/); + } + is($seen,2000); + ok(close(FOO)); +} +else { + skip_all("No perlio, so no :crlf"); +} + + |