File Coverage

blib/lib/Perl6/Junction/None.pm
Criterion Covered Total %
statement 76 76 100.0
branch 50 50 100.0
condition n/a
subroutine 17 17 100.0
pod 0 15 0.0
total 143 158 90.5


line stmt bran cond sub pod time code
1             package Perl6::Junction::None;
2 8     8   42 use strict;
  8         15  
  8         367  
3             our $VERSION = '1.60000';
4              
5 8     8   41 use base 'Perl6::Junction::Base';
  8         12  
  8         7812  
6              
7             sub num_eq {
8 13 100   13 0 117 return regex_eq(@_) if ref( $_[1] ) eq 'Regexp';
9              
10 9         18 my ( $self, $test ) = @_;
11              
12 9         23 for (@$self) {
13 19 100       76 return if $_ == $test;
14             }
15              
16 6         34 return 1;
17             }
18              
19             sub num_ne {
20 8 100   8 0 31 return regex_ne(@_) if ref( $_[1] ) eq 'Regexp';
21              
22 2         4 my ( $self, $test ) = @_;
23              
24 2         5 for (@$self) {
25 3 100       12 return if $_ != $test;
26             }
27              
28 1         5 return 1;
29             }
30              
31             sub num_ge {
32 13     13 0 31 my ( $self, $test, $switch ) = @_;
33              
34 13 100       54 return num_le( $self, $test ) if $switch;
35              
36 8         20 for (@$self) {
37 18 100       59 return if $_ >= $test;
38             }
39              
40 3         15 return 1;
41             }
42              
43             sub num_gt {
44 13     13 0 20 my ( $self, $test, $switch ) = @_;
45              
46 13 100       35 return num_lt( $self, $test ) if $switch;
47              
48 9         26 for (@$self) {
49 21 100       73 return if $_ > $test;
50             }
51              
52 4         19 return 1;
53             }
54              
55             sub num_le {
56 12     12 0 21 my ( $self, $test, $switch ) = @_;
57              
58 12 100       33 return num_ge( $self, $test ) if $switch;
59              
60 8         19 for (@$self) {
61 16 100       55 return if $_ <= $test;
62             }
63              
64 4         19 return 1;
65             }
66              
67             sub num_lt {
68 13     13 0 24 my ( $self, $test, $switch ) = @_;
69              
70 13 100       34 return num_gt( $self, $test ) if $switch;
71              
72 8         15 for (@$self) {
73 16 100       64 return if $_ < $test;
74             }
75              
76 4         17 return 1;
77             }
78              
79             sub str_eq {
80 3     3 0 6 my ( $self, $test ) = @_;
81              
82 3         9 for (@$self) {
83 4 100       18 return if $_ eq $test;
84             }
85              
86 1         6 return 1;
87             }
88              
89             sub str_ne {
90 3     3 0 5 my ( $self, $test ) = @_;
91              
92 3         8 for (@$self) {
93 4 100       19 return if $_ ne $test;
94             }
95              
96 1         5 return 1;
97             }
98              
99             sub str_ge {
100 9     9 0 16 my ( $self, $test, $switch ) = @_;
101              
102 9 100       24 return str_le( $self, $test ) if $switch;
103              
104 6         13 for (@$self) {
105 8 100       41 return if $_ ge $test;
106             }
107              
108 2         15 return 1;
109             }
110              
111             sub str_gt {
112 10     10 0 18 my ( $self, $test, $switch ) = @_;
113              
114 10 100       30 return str_lt( $self, $test ) if $switch;
115              
116 7         15 for (@$self) {
117 12 100       46 return if $_ gt $test;
118             }
119              
120 3         12 return 1;
121             }
122              
123             sub str_le {
124 9     9 0 14 my ( $self, $test, $switch ) = @_;
125              
126 9 100       23 return str_ge( $self, $test ) if $switch;
127              
128 6         12 for (@$self) {
129 8 100       33 return if $_ le $test;
130             }
131              
132 2         9 return 1;
133             }
134              
135             sub str_lt {
136 9     9 0 15 my ( $self, $test, $switch ) = @_;
137              
138 9 100       23 return str_gt( $self, $test ) if $switch;
139              
140 6         10 for (@$self) {
141 8 100       34 return if $_ lt $test;
142             }
143              
144 2         10 return 1;
145             }
146              
147             sub regex_eq {
148 4     4 0 7 my ( $self, $test, $switch ) = @_;
149              
150 4         8 for (@$self) {
151 11 100       52 return if $_ =~ $test;
152             }
153              
154 2         9 return 1;
155             }
156              
157             sub regex_ne {
158 6     6 0 10 my ( $self, $test, $switch ) = @_;
159              
160 6         13 for (@$self) {
161 14 100       71 return if $_ !~ $test;
162             }
163              
164 4         17 return 1;
165             }
166              
167             sub bool {
168 2     2 0 17 my ($self) = @_;
169              
170 2         5 for (@$self) {
171 6 100       15 return if $_;
172             }
173              
174 1         4 return 1;
175             }
176              
177             1;
178