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

[perl #118751] lib/Symbol.t: Add tests for previously uncovered code

From:
James E Keenan
Date:
July 4, 2013 13:46
Subject:
[perl #118751] lib/Symbol.t: Add tests for previously uncovered code
Message ID:
rt-3.6.HEAD-2552-1372945530-1230.118751-75-0@perl.org
# New Ticket Created by  James E Keenan 
# Please include the string:  [perl #118751]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=118751 >


Manual coverage analysis suggests that lib/Symbol.t in blead fails to 
cover (a) the branch implied by the 'unless' in line 148 below; (b) the 
condition implied by the 'and' in line 154.

##########
146     unless ($pkg =~ /^main::.*::$/) {
147         $pkg = "main$pkg"   if  $pkg =~ /^::/;
148         $pkg = "main::$pkg" unless  $pkg =~ /^main::/;
149         $pkg .= '::'        unless  $pkg =~ /::$/;
150     }
151
152     my($stem, $leaf) = $pkg =~ m/(.*::)(\w+::)$/;
153     my $stem_symtab = *{$stem}{HASH};
154     return unless defined $stem_symtab and exists $stem_symtab->{$leaf};
##########

The patch attached adds tests to increase the test coverage.  Please 
review and, if acceptable, apply.

Thank you very much.
Jim Keenan




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