develooper Front page | perl.perl5.porters | Postings from July 2013

[perl #118761] lib/File/Copy.t: Add test for previously untested code

From:
James E Keenan
Date:
July 5, 2013 01:22
Subject:
[perl #118761] lib/File/Copy.t: Add test for previously untested code
Message ID:
rt-3.6.HEAD-2552-1372987296-1704.118761-75-0@perl.org
# New Ticket Created by  James E Keenan 
# Please include the string:  [perl #118761]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=118761 >


In the definition of sub copy() in lib/File/Copy.pm, there is untested code:

##########
     223     unless (defined $size) {
     224     $size = tied(*$from_h) ? 0 : -s $from_h || 0;
     225     $size = 1024 if ($size < 512);
     226     $size = $Too_Big if ($size > $Too_Big);
     227     }
##########

The 'if' branch implied at line 226 is currently untested.  The patch 
attached remedies that situation.  Please review and, if acceptable, apply.

Thank you very much.
Jim Keenan


P.S.:  In the same file's sub cp(), there are several untested blocks 
dealing with permissions issues.  I'm not expert in those, but if anyone 
who is wants to help boost File-Copy's test coverage, please contact me 
off list or catch me on #p5p irc.perl.org (kid51).



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About