diff options
author | arbor@al37al08.telecel.pt <arbor@al37al08.telecel.pt> | 2001-01-16 11:43:02 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-07-31 23:47:57 +0000 |
commit | 96a91e01636d3050d38ae3373a362c7d47a6647e (patch) | |
tree | 6a3c0642b4dd9b32f6b19d1da6b11eee40d35e42 /lib/File/Copy.t | |
parent | dd2de2428c82c0bebb0eff93f4834d1900219f57 (diff) | |
download | perl-96a91e01636d3050d38ae3373a362c7d47a6647e.tar.gz |
Fix for
Subject: [ID 20010116.001] File::Copy truncates orig file
Message-Id: <200101161143.AA11184@al37al08.telecel.pt>
(copy($foo, $foo) would truncate $foo)
p4raw-id: //depot/perl@11526
Diffstat (limited to 'lib/File/Copy.t')
-rwxr-xr-x | lib/File/Copy.t | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/File/Copy.t b/lib/File/Copy.t index 44b5827e72..6f8c801bcf 100755 --- a/lib/File/Copy.t +++ b/lib/File/Copy.t @@ -9,7 +9,7 @@ BEGIN { $| = 1; my @pass = (0,1); -my $tests = $^O eq 'MacOS' ? 14 : 11; +my $tests = $^O eq 'MacOS' ? 15 : 12; printf "1..%d\n", $tests * scalar(@pass); use File::Copy; @@ -116,6 +116,11 @@ for my $pass (@pass) { print "not " unless $foo eq sprintf("ok %d\n", 3+$loopconst) and not -e "file-$$";; printf "ok %d\n", 14+$loopconst; + + eval { copy("copy-$$", "copy-$$") }; + printf "ok %d\n", 15+$loopconst + unless $@ =~ /are identical/ && -s "copy-$$"; + unlink ":lib:file-$$" or die "unlink: $!"; } else { @@ -131,6 +136,11 @@ for my $pass (@pass) { print "not " unless $foo eq sprintf("ok %d\n", 3+$loopconst) and not -e "file-$$";; printf "ok %d\n", 11+$loopconst; + + eval { copy("copy-$$", "copy-$$") }; + printf "ok %d\n", 12+$loopconst + unless $@ =~ /are identical/ && -s "copy-$$"; + unlink "lib/file-$$" or die "unlink: $!"; } |