Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^3: Inverting test conditions in Test::More ? (workaround)

by Arunbear (Prior)
on Jul 24, 2020 at 13:43 UTC ( #11119756=note: print w/replies, xml ) Need Help??


in reply to Re^2: Inverting test conditions in Test::More ? (workaround)
in thread Inverting test conditions in Test::More ?

Are you testing regular code, or testing other tests?

If the former, why not just something like
my $cond = 1 == 2; ok( $cond ); # fails ok( ! $cond ); # passes
... or whatever boolean condition.

If the latter, Test::Builder::Tester seems designed to test other tests.

To be fair, I could be misunderstanding - this is not a use case I've come across before.

Replies are listed 'Best First'.
Re^4: Inverting test conditions in Test::More ? (workaround)
by LanX (Cardinal) on Jul 24, 2020 at 13:54 UTC
    > If the former, why not just something like

    I'm looking for a generic approach, is_deeply is an example where its not that easy, but reiterating an example with is_deeply would lead the thread again into a different direction.

    So either I give a trivial example which is too easy or a complex where people are concentrating on the concrete example instead discussing the abstraction.

    > If the latter, Test::Builder::Tester seems designed to test other tests.

    Good call! looks promising, thanks. :)

    > Are you testing regular code, or testing other tests?

    Both. I already experimented with Test::Builder to generate another Test object redirecting the output.

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2020-09-30 02:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If at first I donít succeed, I Ö










    Results (157 votes). Check out past polls.

    Notices?