edited all .t tests to not use use_ok to load File::Slurp. they now all
[urisagit/Perl-Docs.git] / t / write_file_win32.t
CommitLineData
635c7876 1use strict;
99709852 2use File::Slurp ;
635c7876 3
99709852 4use Test::More tests => 1;
635c7876 5
99709852 6BEGIN { $^W = 1 }
635c7876 7
8sub simple_write_file {
9 open my $fh, '>', $_[0] or die "Couldn't open $_[0] for write: $!";
10 print $fh $_[1];
11}
12
13sub newline_size {
14 my ($code) = @_;
15
16 my $file = __FILE__ . '.tmp';
17
18 local $\ = '';
19 $code->($file, "\n" x 3);
20
21 my $size = -s $file;
22
23 unlink $file;
24
25 return $size;
26}
27
28is(newline_size(\&write_file), newline_size(\&simple_write_file), 'newline');