http://qs321.pair.com?node_id=11119740


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.