Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
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 musing on the Monastery: (12)
As of 2014-10-24 19:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (134 votes), past polls