Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Inverting test conditions in Test::More ?

by Corion (Patriarch)
on Jul 24, 2020 at 09:05 UTC ( [id://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 (Saint) 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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11119740]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (8)
As of 2024-04-19 09:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found