Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Test::Exception extension with (evil?) overloading

by adrianh (Chancellor)
on Jan 18, 2003 at 00:56 UTC ( #227879=perlquestion: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use Test::More 'no_plan';
    use Test::Exception;
    
  2. or download this
    my $result;
    lives_ok {$result = $o->answer} 'answer worked';
    is $result, 42, 'answer returned 42';
    
  3. or download this
    is live{$o->answer}, 42, 'answer worked';
    
  4. or download this
    live
           Returns the result of the given expression if no
    ...
               unlike live {$o->foo}, '/fribble/', 'no fribble';
    
           Appropriate care must be taken.
    
  5. or download this
    use Sub::Uplevel;
    
    ...
        ) if $@;
        $value;
    };
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://227879]
Approved by jeffa
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (10)
As of 2014-12-21 15:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (106 votes), past polls