1Test2::Compare::NegatabUlsee(r3)Contributed Perl DocumenTteastti2o:n:Compare::Negatable(3)
2
3
4
6 Test2::Compare::Negatable - Poor mans 'role' for compare objects that
7 can be negated.
8
10 Using this package inside an Test2::Compare::Base subclass will
11 overload "!$obj" and import "clone_negate()" and "toggle_negate()".
12
14 Until perl 5.18 the 'fallback' parameter to overload would not be
15 inherited, so we cannot use inheritance for the behavior we actually
16 want. This module works around the problem by emulating the "use
17 overload" call we want for each consumer class.
18
20 $bool = $obj->negate
21 $obj->set_negate($bool)
22 $attr = NEGATE()
23 The NEGATE attribute will be added via Test2::Util::HashBase.
24
26 $clone = $obj->clone_negate()
27 Create a shallow copy of the object, and call "toggle_negate" on
28 it.
29
30 $obj->toggle_negate()
31 Toggle the negate attribute. If the attribute was on it will now be
32 off, if it was off it will now be on.
33
35 The source code repository for Test2-Suite can be found at
36 https://github.com/Test-More/Test2-Suite/.
37
39 Chad Granum <exodist@cpan.org>
40
42 Chad Granum <exodist@cpan.org>
43
45 Copyright 2018 Chad Granum <exodist@cpan.org>.
46
47 This program is free software; you can redistribute it and/or modify it
48 under the same terms as Perl itself.
49
50 See http://dev.perl.org/licenses/
51
52
53
54perl v5.32.0 2020-12-16 Test2::Compare::Negatable(3)