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

Re: Inverting test conditions in Test::More ?

by Corion (Pope)
on Jul 24, 2020 at 09:05 UTC ( #11119740=note: print w/replies, xml ) Need Help??


in reply to Inverting test conditions in Test::More ?

Why don't you test directly for where you know the difference is? You won't need is_deeply since you don't need to check all elements. You only need to check that there is at least one difference, and if you know your input data, you know where to find the difference.

Replies are listed 'Best First'.
Re^2: Inverting test conditions in Test::More ?
by LanX (Cardinal) on Jul 24, 2020 at 09:30 UTC
    As I said

    > > Not looking for workarounds for is_deeply but for general test logic.

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

      What part of "instead of checking whether there is any difference, check for a specific difference" is specific to is_deeply and not general test logic?

        > What part of "instead of checking whether there is any difference, check for a specific difference" is specific to is_deeply and not general test logic?

        well you spoke specifically about is_deeply

        > > > You won't need is_deeply

        I think my demo of a workaround shows what I wanted, since all tests are returning a boolean result.

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

      Sounds like you're just trying to illicit specific responses. Better to just come out and say what you want to say rather than attempt to be coy about it.

Log In?
Username:
Password:

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

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










    Results (141 votes). Check out past polls.

    Notices?