Posted on 2009-04-16 20:49:58-07 by fergal in response to 10494
Re: Inverted set comparisons

I'm not sure which you mean. Is it something like

cmp_deeply($array, doesnt_contain([1, 3, 5])

? If so then no it's not provided.

You can write custom comparators easily enough. Have a look at lib/Test/Deep/Boolean.pm for a simple example.

If on the other hand you mean something like

cmp_deeply($thing, not_any_of($thing1, $thing2, $thing3))

then it's also not provided but could be done easily enough if there was an Not() comparator:

cmp_deeply($thing, Not(any($thing1, $thing2, $thing3)))

sadly there is no Not comparator. You could write one easily, if you do, let me know and I'll ship it built-in as it's a generally useful thing to have.

Direct Responses: Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.