Test2::...egatable(3)
okay so bestie, welcome to the Test2::Compare::Negatable page β you might see it tagged as Test2::...egatable(3) in the User Contributed Perl Documentation, and we are so here for it β¨
πΈ NAME πΈ
Test2::Compare::Negatable β literally βPoor mans 'role' for compare objects that can be negated.β π
π¦ DESCRIPTION π¦
Using this package inside a Test2::Compare::Base subclass will overload "!$obj" and import clone_negate() and toggle_negate(). no cap, that's the whole move π«Ά
π WHY? π
Until perl 5.18 the'fallback'parameter tooverloadwould not be inherited, so we cannot use inheritance for the behavior we actually want. This module works around the problem by emulating theuse overloadcall we want for each consumer class.
it's giving βold perl said no inheritance for this vibe, so we emulated it per class,β and honestly? iconic problem-solving π₯
π ATTRIBUTES π
$bool = $obj->negateβ the negate accessor signature, right here bestie π$obj->set_negate($bool)β the setter signature for that same negate bool β¨$attr = NEGATE()β theNEGATEattribute will be added viaTest2::Util::HashBase. periodt π§
π METHODS π
$clone = $obj->clone_negate()β Create a shallow copy of the object, and call"toggle_negate"on it. shallow copy slay, but it's a shallow copy, okay? π$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 main character energy π
π SOURCE π
The source code repository for Test2-Suite can be found at https://github.com/Test-More/test-more/. go off, repo π«Ά
π MAINTAINERS π
Chad Granum <exodist@cpan.org>
β AUTHORS β
Chad Granum <exodist@cpan.org>
π 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/
that's the whole page, bestie π cute little sign-off: perl v5.42.0, 2025-07-28, and the page tag Test2::...egatable(3) β mwah ππ
π¦ where this page comes from
- opensuse-leap 16.0: perl-Test-Simple 1.302214-bp160.1.2 Β· Artistic-1.0 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