Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
I've only just started looking into Test::More and its kin, but the only other idea I have off hand is to pass a closure to a test function, to defer calling it until after the reusable code can throw an eval around it. That's what you mean by lives_and_is, right? Your complaint is that you have to duplicate all the tests to have a "lives" version.

So, you want to wrap the sub-ref argument so that it can orthogonally apply to all the tests.

Another way to have a modifier that applies orthogonally to all tests would be to pass the underlying test as well:

wrapper (\&innertest, \&subref, @args)
This would evaluate subref in an eval, failing if it dies. Then, take the result and pass it, along with the remaining @args, to the innertest function, whose result is returned.

So you could pass anything you want as the inner test.

wrapper (\&is, {$o->answer}, 42, 'answer returned 42');

In reply to Re: Test::Exception extension with (evil?) overloading by John M. Dlugosz
in thread Test::Exception extension with (evil?) overloading by adrianh

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others contemplating the Monastery: (6)
    As of 2018-06-20 00:08 GMT
    Find Nodes?
      Voting Booth?
      Should cpanminus be part of the standard Perl release?

      Results (116 votes). Check out past polls.