Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
Perl Monk, Perl Meditation
 
PerlMonks  

Re^3: TDD with Coverage Analysis. Wow.

by tlm (Prior)
on Aug 27, 2005 at 13:20 UTC ( [id://487167]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Re^2: TDD with Coverage Analysis. Wow.
in thread TDD with Coverage Analysis. Wow.

Can you invoke it directly in the test script as &{$SIG{__DIE__}} and test accordingly from there?

Only if the !$^S branch doesn't die (and doesn't call something that does). I should have made that clearer in my original post. Will fix. Thanks.

# potential workaround use constant DEFAULT_FILENAME => 'foo.txt'; my $filename = prompt_for_filename() || DEFAULT_FILENAME;

I don't see how the second alternative of the || could ever be false (i.e. the coverage would never be 100%).

Update: Ah, I see.

the lowliest monk

Replies are listed 'Best First'.
Re^4: TDD with Coverage Analysis. Wow.
by davidrw (Prior) on Aug 27, 2005 at 13:32 UTC
    I don't see how the second alternative of the || could ever be false (i.e. the coverage would never be 100%).
    It can't, but just like with xdg's note about my $value = $some_other_value || undef;, Devel::Cover is also smart enough to realize that DEFAULT_FILENAME is a constant and removes the truth table entries of it being false, so that you can get to 100% coverage for that line.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://487167]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.