3 # Formerly, on a Win32 system, Tie::File would create files with
4 # \n-terminated records instead of \r\n-terminated. The tests never
5 # picked this up because they were using $/ everywhere, and $/ is \n
8 # These tests (Win32 only) make sure that the file had \r\n as it should.
10 my $file = "tf$$.txt";
12 unless ($^O =~ /^(MSWin32|dos)$/) {
22 print "ok $N\n"; $N++;
24 my $o = tie @a, 'Tie::File', $file, autodefer => 0;
25 print $o ? "ok $N\n" : "not ok $N\n";
30 # (3) Make sure that on Win32 systems, the file is written with \r\n by default
31 @a = qw(fish dog carrot);
34 open F, "< $file" or die "Couldn't open file $file: $!";
36 my $a = do {local $/ ; <F> };
37 my $x = "fish\r\ndog\r\ncarrot\r\n" ;
41 ctrlfix(my $msg = "expected <$x>, got <$a>");
42 print "not ok $N # $msg\n";