TEST2::COMPARE::NEGATABLE(3pm)
πΈ NAME
okay so this is Test2::Compare::Negatable(3pm), straight from Perl Programmers Reference Guide. Its whole thing is literally a βPoor mans 'role' for compare objects that can be negated.β Bestie, that's the name and the vibe. π
π DESCRIPTION
Using this package inside an Test2::Compare::Base subclass will overload !$obj and import clone_negate() and toggle_negate(). That's the whole move. β¨
π§ WHY?
Until perl 5.18 the 'fallback' parameter to overload would not be inherited, so we cannot use inheritance for the behavior we actually want. This module works around the problem by emulating the "use overload" call we want for each consumer class. No cap, it's a workaround era. π
π ATTRIBUTES
$bool = $obj->negateβ thenegatesignature, exactly as written.$obj->set_negate($bool)β theset_negate($bool)signature, exactly as written.$attr = NEGATE()β theNEGATE()signature, exactly as written.
The NEGATE attribute will be added via Test2::Util::HashBase. iykyk β¨
π¦ METHODS
$clone = $obj->clone_negate()β Create a shallow copy of the object, and call"toggle_negate"on it. Shallow copy, bestie β not a deep clone. β¨$obj->toggle_negate()β Toggle the negate attribute. If the attribute was on it will now be off, if it was off it will now be on. Flip-flop era, literally. π
π SOURCE
The source code repository for Test2-Suite can be found at https://github.com/Test-More/test-more/. Go lurk, it's giving open source. π
π MAINTAINERS
Chad Granum <exodist@cpan.org> β the maintainer, periodt.
π AUTHORS
Chad Granum <exodist@cpan.org> β same icon, author credit.
π COPYRIGHT
Copyright Chad Granum <exodist@cpan.org>.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See http://dev.perl.org/licenses/.
and that's the whole page, bestie β every detail kept, fr fr. This one's from perl v5.42.3, dated 2026-11-03, and it's the Test2::Compare::Negatable(3pm) manual. π
β¨π«Ά
π¦ where this page comes from
- alpine 3.24: perl-doc 5.42.3-r0 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms