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


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

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

  • Comment on Re^2: Inverting test conditions in Test::More ?

Replies are listed 'Best First'.
Re^3: Inverting test conditions in Test::More ?
by Corion (Patriarch) on Jul 24, 2020 at 13:00 UTC

    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

        I only mention is_deeply in this sentence:

        You won't need is_deeply since you don't need to check all elements.

        In what way is "You won't need is_deeply" specifically about is_deeply? The approach of testing for a specific known difference in your prepared data is a general approach that works for your cases, or at least you haven't shown a counterexample.

Re^3: Inverting test conditions in Test::More ?
by perlfan (Vicar) on Jul 24, 2020 at 12:54 UTC
    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.