| 1 | package TPath::Test::Not; | ||
| 2 | $TPath::Test::Not::VERSION = '1.007'; | ||
| 3 | # ABSTRACT: implements logical negation of a test | ||
| 4 | |||
| 5 | |||
| 6 | 1 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | 1 | ▶ | use TPath::Test; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | 0 | ▶ | use TPath::TypeConstraints; |
|
Subroutine
BEGIN: called CC=1 SCAR=2.6
| |||
| 9 | |||
| 10 | |||
| 11 | with 'TPath::Test::Boolean'; | ||
| 12 | |||
| 13 | |||
| 14 | has t => ( is => 'ro', isa => 'CondArg', required => 1 ); | ||
| 15 | |||
| 16 | # required by TPath::Test | ||
| 17 | sub test { | ||
| 18 | my ( $self, $ctx ) = @_; | ||
| 19 | return $self->t->test($ctx) ? 0 : 1; | ||
| 20 | } | ||
| 21 | |||
| 22 | sub to_string { | ||
| 23 | my $self = shift; | ||
| 24 | return '!' . $self->t->to_string; | ||
| 25 | } | ||
| 26 | |||
| 27 | __PACKAGE__->meta->make_immutable; | ||
| 28 | |||
| 29 | 1; | ||
| 30 | |||
| 31 | __END__ | ||