diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2011-06-07 08:06:16 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2011-06-07 08:06:16 +0000 |
commit | 9d4173f2716c2f9a2d26f8f9ab0f47b351b87de7 (patch) | |
tree | 98ae3fb82096d8bb96686512ada27fa72126b09a /t/write_file_win32.t | |
download | File-Slurp-tarball-master.tar.gz |
File-Slurp-9999.19HEADFile-Slurp-9999.19master
Diffstat (limited to 't/write_file_win32.t')
-rw-r--r-- | t/write_file_win32.t | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/t/write_file_win32.t b/t/write_file_win32.t new file mode 100644 index 0000000..1e42456 --- /dev/null +++ b/t/write_file_win32.t @@ -0,0 +1,29 @@ +use strict; +use File::Slurp ; + +use Test::More tests => 1; + +BEGIN { $^W = 1 } + +sub simple_write_file { + open FH, ">$_[0]" or die "Couldn't open $_[0] for write: $!"; + print FH $_[1]; + close FH ; +} + +sub newline_size { + my ($code) = @_; + + my $file = __FILE__ . '.tmp'; + + local $\ = ''; + $code->($file, "\n" x 3); + + my $size = -s $file; + + unlink $file; + + return $size; +} + +is(newline_size(\&write_file), newline_size(\&simple_write_file), 'newline'); |