diff options
-rw-r--r-- | MANIFEST | 1 | ||||
-rw-r--r-- | t/io/crlf.t | 42 |
2 files changed, 43 insertions, 0 deletions
@@ -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 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"); +} + + |