| 1 | package TPath::Test::Compound; | ||
| 2 | $TPath::Test::Compound::VERSION = '1.007'; | ||
| 3 | # ABSTRACT: role of TPath::Tests that combine multiple other tests under some boolean operator | ||
| 4 | |||
| 5 | 4 | ▶ | use Moose::Role; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 0 | ▶ | use TPath::TypeConstraints; |
|
Subroutine
BEGIN: called CC=1 SCAR=2.6
| |||
| 7 | |||
| 8 | |||
| 9 | with 'TPath::Test::Boolean'; | ||
| 10 | |||
| 11 | |||
| 12 | has tests => ( is => 'ro', isa => 'ArrayRef[CondArg]', required => 1 ); | ||
| 13 | |||
| 14 | sub _compound_to_string { | ||
| 15 | my ( $self, $op ) = @_; | ||
| 16 | my $s = '('; | ||
| 17 | my @tests = @{ $self->tests }; | ||
| 18 | $s .= $tests[0]->to_string; | ||
| 19 | for my $t ( @tests[ 1 .. $#tests ] ) { | ||
| 20 | $s .= " $op " . $t->to_string; | ||
| 21 | } | ||
| 22 | $s .= ')'; | ||
| 23 | return $s; | ||
| 24 | } | ||
| 25 | |||
| 26 | 1; | ||
| 27 | |||
| 28 | __END__ | ||