line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
use strict; |
3
|
11
|
|
|
11
|
|
639166
|
use warnings; |
|
11
|
|
|
|
|
101
|
|
|
11
|
|
|
|
|
272
|
|
4
|
11
|
|
|
11
|
|
49
|
|
|
11
|
|
|
|
|
16
|
|
|
11
|
|
|
|
|
389
|
|
5
|
|
|
|
|
|
|
our $VERSION = '0.48'; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
use IO::File; |
8
|
11
|
|
|
11
|
|
4289
|
use Scalar::Util qw( blessed looks_like_number openhandle ); |
|
11
|
|
|
|
|
77796
|
|
|
11
|
|
|
|
|
990
|
|
9
|
11
|
|
|
11
|
|
84
|
use Specio::Library::Builtins; |
|
11
|
|
|
|
|
18
|
|
|
11
|
|
|
|
|
473
|
|
10
|
11
|
|
|
11
|
|
4654
|
use Specio::Library::Numeric; |
|
11
|
|
|
|
|
37
|
|
|
11
|
|
|
|
|
126
|
|
11
|
11
|
|
|
11
|
|
4738
|
use Specio::Library::Perl; |
|
11
|
|
|
|
|
35
|
|
|
11
|
|
|
|
|
126
|
|
12
|
11
|
|
|
11
|
|
4625
|
use Specio::Library::String; |
|
11
|
|
|
|
|
33
|
|
|
11
|
|
|
|
|
112
|
|
13
|
11
|
|
|
11
|
|
61
|
|
|
11
|
|
|
|
|
21
|
|
|
11
|
|
|
|
|
62
|
|
14
|
|
|
|
|
|
|
# Loading this will force subification to use Sub::Quote, which can expose |
15
|
|
|
|
|
|
|
# some bugs. |
16
|
|
|
|
|
|
|
use Sub::Quote; |
17
|
11
|
|
|
11
|
|
4847
|
use Test::Fatal; |
|
11
|
|
|
|
|
44763
|
|
|
11
|
|
|
|
|
582
|
|
18
|
11
|
|
|
11
|
|
2708
|
use Test::More 0.96; |
|
11
|
|
|
|
|
19487
|
|
|
11
|
|
|
|
|
465
|
|
19
|
11
|
|
|
11
|
|
62
|
use Try::Tiny; |
|
11
|
|
|
|
|
325
|
|
|
11
|
|
|
|
|
92
|
|
20
|
11
|
|
|
11
|
|
2556
|
|
|
11
|
|
|
|
|
20
|
|
|
11
|
|
|
|
|
425
|
|
21
|
|
|
|
|
|
|
use Exporter qw( import ); |
22
|
11
|
|
|
11
|
|
55
|
|
|
11
|
|
|
|
|
30
|
|
|
11
|
|
|
|
|
4376
|
|
23
|
|
|
|
|
|
|
our $ZERO = 0; |
24
|
|
|
|
|
|
|
our $ONE = 1; |
25
|
|
|
|
|
|
|
our $INT = 100; |
26
|
|
|
|
|
|
|
our $NEG_INT = -100; |
27
|
|
|
|
|
|
|
our $NUM = 42.42; |
28
|
|
|
|
|
|
|
our $NEG_NUM = -42.42; |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
our $EMPTY_STRING = q{}; |
31
|
|
|
|
|
|
|
our $STRING = 'foo'; |
32
|
|
|
|
|
|
|
our $NUM_IN_STRING = 'has 42 in it'; |
33
|
|
|
|
|
|
|
our $INT_WITH_NL1 = "1\n"; |
34
|
|
|
|
|
|
|
our $INT_WITH_NL2 = "\n1"; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
our $SCALAR_REF = do { |
37
|
|
|
|
|
|
|
## no critic (Variables::ProhibitUnusedVariables) |
38
|
|
|
|
|
|
|
\( my $var ); |
39
|
|
|
|
|
|
|
}; |
40
|
|
|
|
|
|
|
our $SCALAR_REF_REF = \$SCALAR_REF; |
41
|
|
|
|
|
|
|
our $ARRAY_REF = []; |
42
|
|
|
|
|
|
|
our $HASH_REF = {}; |
43
|
|
|
|
|
|
|
our $CODE_REF = sub { }; |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
our $GLOB_REF = \*GLOB; |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
our $FH; |
48
|
|
|
|
|
|
|
## no critic (InputOutput::RequireBriefOpen) |
49
|
|
|
|
|
|
|
open $FH, '<', $INC{'Test/Specio.pm'} |
50
|
|
|
|
|
|
|
or die "Could not open $INC{'Test/Specio.pm'} for the test"; |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
our $FH_OBJECT = IO::File->new( $INC{'Test/Specio.pm'}, 'r' ) |
53
|
|
|
|
|
|
|
or die "Could not open $INC{'Test/Specio.pm'} for the test"; |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
our $REGEX = qr/../; |
56
|
|
|
|
|
|
|
our $REGEX_OBJ = bless qr/../, 'BlessedQR'; |
57
|
|
|
|
|
|
|
our $FAKE_REGEX = bless {}, 'Regexp'; |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
our $OBJECT = bless {}, 'FakeObject'; |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
our $UNDEF = undef; |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
## no critic (Modules::ProhibitMultiplePackages) |
64
|
|
|
|
|
|
|
{ |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
our $CLASS_NAME = '_T::Thing'; |
68
|
|
|
|
0
|
|
|
|
69
|
|
|
|
|
|
|
{ |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
use overload |
72
|
|
|
|
|
|
|
'bool' => sub { ${ $_[0] } }, |
73
|
|
|
|
|
|
|
fallback => 0; |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
my $bool = $_[1]; |
76
|
|
|
|
|
|
|
bless \$bool, __PACKAGE__; |
77
|
388
|
|
|
388
|
|
493
|
} |
|
388
|
|
|
|
|
1185
|
|
78
|
11
|
|
|
11
|
|
71
|
|
|
11
|
|
|
|
|
18
|
|
|
11
|
|
|
|
|
106
|
|
79
|
|
|
|
|
|
|
our $BOOL_OVERLOAD_TRUE = _T::BoolOverload->new(1); |
80
|
|
|
|
|
|
|
our $BOOL_OVERLOAD_FALSE = _T::BoolOverload->new(0); |
81
|
22
|
|
|
22
|
|
34
|
|
82
|
22
|
|
|
|
|
40
|
{ |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
use overload |
85
|
|
|
|
|
|
|
q{""} => sub { ${ $_[0] } }, |
86
|
|
|
|
|
|
|
fallback => 0; |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
my $str = $_[1]; |
89
|
|
|
|
|
|
|
bless \$str, __PACKAGE__; |
90
|
|
|
|
|
|
|
} |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
our $STR_OVERLOAD_EMPTY = _T::StrOverload->new(q{}); |
93
|
305
|
|
|
305
|
|
6139
|
our $STR_OVERLOAD_FULL = _T::StrOverload->new('full'); |
|
305
|
|
|
|
|
1295
|
|
94
|
11
|
|
|
11
|
|
1757
|
our $STR_OVERLOAD_CLASS_NAME = _T::StrOverload->new('_T::StrOverload'); |
|
11
|
|
|
|
|
23
|
|
|
11
|
|
|
|
|
62
|
|
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
{ |
97
|
33
|
|
|
33
|
|
47
|
|
98
|
33
|
|
|
|
|
49
|
use overload |
99
|
|
|
|
|
|
|
'0+' => sub { ${ $_[0] } }, |
100
|
|
|
|
|
|
|
'+' => sub { ${ $_[0] } + $_[1] }, |
101
|
|
|
|
|
|
|
fallback => 0; |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
my $num = $_[1]; |
104
|
|
|
|
|
|
|
bless \$num, __PACKAGE__; |
105
|
|
|
|
|
|
|
} |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
our $NUM_OVERLOAD_ZERO = _T::NumOverload->new(0); |
108
|
|
|
|
|
|
|
our $NUM_OVERLOAD_ONE = _T::NumOverload->new(1); |
109
|
|
|
|
|
|
|
our $NUM_OVERLOAD_NEG = _T::NumOverload->new(-42); |
110
|
0
|
|
|
0
|
|
0
|
our $NUM_OVERLOAD_DECIMAL = _T::NumOverload->new(42.42); |
|
0
|
|
|
|
|
0
|
|
111
|
100
|
|
|
100
|
|
9850
|
our $NUM_OVERLOAD_NEG_DECIMAL = _T::NumOverload->new(42.42); |
|
100
|
|
|
|
|
1217
|
|
112
|
11
|
|
|
11
|
|
1983
|
|
|
11
|
|
|
|
|
21
|
|
|
11
|
|
|
|
|
103
|
|
113
|
|
|
|
|
|
|
{ |
114
|
|
|
|
|
|
|
|
115
|
55
|
|
|
55
|
|
74
|
use overload |
116
|
55
|
|
|
|
|
107
|
'&{}' => sub { ${ $_[0] } }, |
117
|
|
|
|
|
|
|
fallback => 0; |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
my $code = $_[1]; |
120
|
|
|
|
|
|
|
bless \$code, __PACKAGE__; |
121
|
|
|
|
|
|
|
} |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
our $CODE_OVERLOAD = _T::CodeOverload->new( sub { } ); |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
{ |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
use overload |
128
|
|
|
|
|
|
|
'qr' => sub { ${ $_[0] } }, |
129
|
|
|
|
|
|
|
fallback => 0; |
130
|
0
|
|
|
0
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
131
|
11
|
|
|
11
|
|
2128
|
my $regex = $_[1]; |
|
11
|
|
|
|
|
19
|
|
|
11
|
|
|
|
|
64
|
|
132
|
|
|
|
|
|
|
bless \$regex, __PACKAGE__; |
133
|
|
|
|
|
|
|
} |
134
|
11
|
|
|
11
|
|
20
|
|
135
|
11
|
|
|
|
|
27
|
our $REGEX_OVERLOAD = _T::RegexOverload->new(qr/foo/); |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
{ |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
use overload |
140
|
|
|
|
|
|
|
'*{}' => sub { ${ $_[0] } }, |
141
|
|
|
|
|
|
|
fallback => 0; |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
my $glob = $_[1]; |
144
|
|
|
|
|
|
|
bless \$glob, __PACKAGE__; |
145
|
0
|
|
|
0
|
|
0
|
} |
|
0
|
|
|
|
|
0
|
|
146
|
11
|
|
|
11
|
|
1568
|
|
|
11
|
|
|
|
|
23
|
|
|
11
|
|
|
|
|
57
|
|
147
|
|
|
|
|
|
|
{ |
148
|
|
|
|
|
|
|
|
149
|
11
|
|
|
11
|
|
20
|
use overload |
150
|
11
|
|
|
|
|
21
|
'${}' => sub { $_[0][0] }, |
151
|
|
|
|
|
|
|
fallback => 0; |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
my $scalar = $_[1]; |
154
|
|
|
|
|
|
|
bless [$scalar], __PACKAGE__; |
155
|
|
|
|
|
|
|
} |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
our $SCALAR_OVERLOAD = _T::ScalarOverload->new('x'); |
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
{ |
160
|
11
|
|
|
11
|
|
1682
|
|
|
11
|
|
|
|
|
72
|
|
161
|
11
|
|
|
11
|
|
1628
|
use overload |
|
11
|
|
|
|
|
21
|
|
|
11
|
|
|
|
|
72
|
|
162
|
|
|
|
|
|
|
'@{}' => sub { $_[0]{array} }, |
163
|
|
|
|
|
|
|
fallback => 0; |
164
|
18
|
|
|
18
|
|
1102
|
|
165
|
18
|
|
|
|
|
54
|
my $array = $_[1]; |
166
|
|
|
|
|
|
|
bless { array => $array }, __PACKAGE__; |
167
|
|
|
|
|
|
|
} |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
our $ARRAY_OVERLOAD = _T::ArrayOverload->new( [ 1, 2, 3 ] ); |
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
{ |
172
|
|
|
|
|
|
|
|
173
|
0
|
|
|
0
|
|
0
|
use overload |
174
|
11
|
|
|
11
|
|
1332
|
'%{}' => sub { $_[0][0] }, |
|
11
|
|
|
|
|
21
|
|
|
11
|
|
|
|
|
71
|
|
175
|
|
|
|
|
|
|
fallback => 0; |
176
|
|
|
|
|
|
|
|
177
|
11
|
|
|
11
|
|
20
|
my $hash = $_[1]; |
178
|
11
|
|
|
|
|
24
|
|
179
|
|
|
|
|
|
|
# We use an array-based object so we make sure we test hash |
180
|
|
|
|
|
|
|
# overloading as opposed to just treating the object as a hash. |
181
|
|
|
|
|
|
|
bless [$hash], __PACKAGE__; |
182
|
|
|
|
|
|
|
} |
183
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
our $HASH_OVERLOAD = _T::HashOverload->new( { x => 42, y => 84 } ); |
185
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
my @vars; |
187
|
|
|
|
|
|
|
|
188
|
66
|
|
|
66
|
|
1377
|
BEGIN { |
189
|
11
|
|
|
11
|
|
1491
|
open my $fh, '<', $INC{'Test/Specio.pm'} or die $!; |
|
11
|
|
|
|
|
23
|
|
|
11
|
|
|
|
|
54
|
|
190
|
|
|
|
|
|
|
while (<$fh>) { |
191
|
|
|
|
|
|
|
push @vars, $1 if /^our (\$[A-Z0-9_]+)(?: +=|;)/; |
192
|
11
|
|
|
11
|
|
21
|
} |
193
|
11
|
|
|
|
|
40
|
} |
194
|
|
|
|
|
|
|
|
195
|
|
|
|
|
|
|
our @EXPORT_OK = ( @vars, qw( builtins_tests describe test_constraint ) ); |
196
|
|
|
|
|
|
|
our %EXPORT_TAGS = ( vars => \@vars ); |
197
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
my $GLOB = shift; |
199
|
|
|
|
|
|
|
my $GLOB_OVERLOAD = shift; |
200
|
|
|
|
|
|
|
my $GLOB_OVERLOAD_FH = shift; |
201
|
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
return { |
203
|
227
|
|
|
227
|
|
4604
|
Item => { |
204
|
11
|
|
|
11
|
|
1527
|
accept => [ |
|
11
|
|
|
|
|
28
|
|
|
11
|
|
|
|
|
59
|
|
205
|
|
|
|
|
|
|
$ZERO, |
206
|
|
|
|
|
|
|
$ONE, |
207
|
21
|
|
|
21
|
|
46
|
$BOOL_OVERLOAD_TRUE, |
208
|
|
|
|
|
|
|
$BOOL_OVERLOAD_FALSE, |
209
|
|
|
|
|
|
|
$INT, |
210
|
|
|
|
|
|
|
$NEG_INT, |
211
|
21
|
|
|
|
|
129
|
$NUM, |
212
|
|
|
|
|
|
|
$NEG_NUM, |
213
|
|
|
|
|
|
|
$NUM_OVERLOAD_ZERO, |
214
|
|
|
|
|
|
|
$NUM_OVERLOAD_ONE, |
215
|
|
|
|
|
|
|
$NUM_OVERLOAD_NEG, |
216
|
|
|
|
|
|
|
$NUM_OVERLOAD_NEG_DECIMAL, |
217
|
|
|
|
|
|
|
$NUM_OVERLOAD_DECIMAL, |
218
|
|
|
|
|
|
|
$EMPTY_STRING, |
219
|
|
|
|
|
|
|
$STRING, |
220
|
11
|
50
|
|
11
|
|
2585
|
$NUM_IN_STRING, |
221
|
11
|
|
|
|
|
351
|
$STR_OVERLOAD_EMPTY, |
222
|
17127
|
100
|
|
|
|
56442
|
$STR_OVERLOAD_FULL, |
223
|
|
|
|
|
|
|
$INT_WITH_NL1, |
224
|
|
|
|
|
|
|
$INT_WITH_NL2, |
225
|
|
|
|
|
|
|
$SCALAR_REF, |
226
|
|
|
|
|
|
|
$SCALAR_REF_REF, |
227
|
|
|
|
|
|
|
$SCALAR_OVERLOAD, |
228
|
|
|
|
|
|
|
$ARRAY_REF, |
229
|
|
|
|
|
|
|
$ARRAY_OVERLOAD, |
230
|
2
|
|
|
2
|
1
|
12
|
$HASH_REF, |
231
|
2
|
|
|
|
|
4
|
$HASH_OVERLOAD, |
232
|
2
|
|
|
|
|
4
|
$CODE_REF, |
233
|
|
|
|
|
|
|
$CODE_OVERLOAD, |
234
|
|
|
|
|
|
|
$GLOB, |
235
|
2
|
|
|
|
|
171
|
$GLOB_REF, |
236
|
|
|
|
|
|
|
$GLOB_OVERLOAD, |
237
|
|
|
|
|
|
|
$GLOB_OVERLOAD_FH, |
238
|
|
|
|
|
|
|
$FH, |
239
|
|
|
|
|
|
|
$FH_OBJECT, |
240
|
|
|
|
|
|
|
$REGEX, |
241
|
|
|
|
|
|
|
$REGEX_OBJ, |
242
|
|
|
|
|
|
|
$REGEX_OVERLOAD, |
243
|
|
|
|
|
|
|
$FAKE_REGEX, |
244
|
|
|
|
|
|
|
$OBJECT, |
245
|
|
|
|
|
|
|
$UNDEF, |
246
|
|
|
|
|
|
|
], |
247
|
|
|
|
|
|
|
}, |
248
|
|
|
|
|
|
|
Defined => { |
249
|
|
|
|
|
|
|
accept => [ |
250
|
|
|
|
|
|
|
$ZERO, |
251
|
|
|
|
|
|
|
$ONE, |
252
|
|
|
|
|
|
|
$BOOL_OVERLOAD_TRUE, |
253
|
|
|
|
|
|
|
$BOOL_OVERLOAD_FALSE, |
254
|
|
|
|
|
|
|
$INT, |
255
|
|
|
|
|
|
|
$NEG_INT, |
256
|
|
|
|
|
|
|
$NUM, |
257
|
|
|
|
|
|
|
$NEG_NUM, |
258
|
|
|
|
|
|
|
$NUM_OVERLOAD_ZERO, |
259
|
|
|
|
|
|
|
$NUM_OVERLOAD_ONE, |
260
|
|
|
|
|
|
|
$NUM_OVERLOAD_NEG, |
261
|
|
|
|
|
|
|
$NUM_OVERLOAD_NEG_DECIMAL, |
262
|
|
|
|
|
|
|
$NUM_OVERLOAD_DECIMAL, |
263
|
|
|
|
|
|
|
$EMPTY_STRING, |
264
|
|
|
|
|
|
|
$STRING, |
265
|
|
|
|
|
|
|
$NUM_IN_STRING, |
266
|
|
|
|
|
|
|
$STR_OVERLOAD_EMPTY, |
267
|
|
|
|
|
|
|
$STR_OVERLOAD_FULL, |
268
|
|
|
|
|
|
|
$INT_WITH_NL1, |
269
|
|
|
|
|
|
|
$INT_WITH_NL2, |
270
|
|
|
|
|
|
|
$SCALAR_REF, |
271
|
|
|
|
|
|
|
$SCALAR_REF_REF, |
272
|
|
|
|
|
|
|
$SCALAR_OVERLOAD, |
273
|
|
|
|
|
|
|
$ARRAY_REF, |
274
|
|
|
|
|
|
|
$ARRAY_OVERLOAD, |
275
|
|
|
|
|
|
|
$HASH_REF, |
276
|
|
|
|
|
|
|
$HASH_OVERLOAD, |
277
|
|
|
|
|
|
|
$CODE_REF, |
278
|
|
|
|
|
|
|
$CODE_OVERLOAD, |
279
|
|
|
|
|
|
|
$GLOB, |
280
|
|
|
|
|
|
|
$GLOB_REF, |
281
|
|
|
|
|
|
|
$GLOB_OVERLOAD, |
282
|
|
|
|
|
|
|
$GLOB_OVERLOAD_FH, |
283
|
|
|
|
|
|
|
$FH, |
284
|
|
|
|
|
|
|
$FH_OBJECT, |
285
|
|
|
|
|
|
|
$REGEX, |
286
|
|
|
|
|
|
|
$REGEX_OBJ, |
287
|
|
|
|
|
|
|
$REGEX_OVERLOAD, |
288
|
|
|
|
|
|
|
$FAKE_REGEX, |
289
|
|
|
|
|
|
|
$OBJECT, |
290
|
|
|
|
|
|
|
], |
291
|
|
|
|
|
|
|
reject => [ |
292
|
|
|
|
|
|
|
$UNDEF, |
293
|
|
|
|
|
|
|
], |
294
|
|
|
|
|
|
|
}, |
295
|
|
|
|
|
|
|
Undef => { |
296
|
|
|
|
|
|
|
accept => [ |
297
|
|
|
|
|
|
|
$UNDEF, |
298
|
|
|
|
|
|
|
], |
299
|
|
|
|
|
|
|
reject => [ |
300
|
|
|
|
|
|
|
$ZERO, |
301
|
|
|
|
|
|
|
$ONE, |
302
|
|
|
|
|
|
|
$BOOL_OVERLOAD_TRUE, |
303
|
|
|
|
|
|
|
$BOOL_OVERLOAD_FALSE, |
304
|
|
|
|
|
|
|
$INT, |
305
|
|
|
|
|
|
|
$NEG_INT, |
306
|
|
|
|
|
|
|
$NUM, |
307
|
|
|
|
|
|
|
$NEG_NUM, |
308
|
|
|
|
|
|
|
$NUM_OVERLOAD_ZERO, |
309
|
|
|
|
|
|
|
$NUM_OVERLOAD_ONE, |
310
|
|
|
|
|
|
|
$NUM_OVERLOAD_NEG, |
311
|
|
|
|
|
|
|
$NUM_OVERLOAD_NEG_DECIMAL, |
312
|
|
|
|
|
|
|
$NUM_OVERLOAD_DECIMAL, |
313
|
|
|
|
|
|
|
$EMPTY_STRING, |
314
|
|
|
|
|
|
|
$STRING, |
315
|
|
|
|
|
|
|
$NUM_IN_STRING, |
316
|
|
|
|
|
|
|
$STR_OVERLOAD_EMPTY, |
317
|
|
|
|
|
|
|
$STR_OVERLOAD_FULL, |
318
|
|
|
|
|
|
|
$INT_WITH_NL1, |
319
|
|
|
|
|
|
|
$INT_WITH_NL2, |
320
|
|
|
|
|
|
|
$SCALAR_REF, |
321
|
|
|
|
|
|
|
$SCALAR_REF_REF, |
322
|
|
|
|
|
|
|
$SCALAR_OVERLOAD, |
323
|
|
|
|
|
|
|
$ARRAY_REF, |
324
|
|
|
|
|
|
|
$ARRAY_OVERLOAD, |
325
|
|
|
|
|
|
|
$HASH_REF, |
326
|
|
|
|
|
|
|
$HASH_OVERLOAD, |
327
|
|
|
|
|
|
|
$CODE_REF, |
328
|
|
|
|
|
|
|
$CODE_OVERLOAD, |
329
|
|
|
|
|
|
|
$GLOB, |
330
|
|
|
|
|
|
|
$GLOB_REF, |
331
|
|
|
|
|
|
|
$GLOB_OVERLOAD, |
332
|
|
|
|
|
|
|
$GLOB_OVERLOAD_FH, |
333
|
|
|
|
|
|
|
$FH, |
334
|
|
|
|
|
|
|
$FH_OBJECT, |
335
|
|
|
|
|
|
|
$REGEX, |
336
|
|
|
|
|
|
|
$REGEX_OBJ, |
337
|
|
|
|
|
|
|
$REGEX_OVERLOAD, |
338
|
|
|
|
|
|
|
$FAKE_REGEX, |
339
|
|
|
|
|
|
|
$OBJECT, |
340
|
|
|
|
|
|
|
], |
341
|
|
|
|
|
|
|
}, |
342
|
|
|
|
|
|
|
Bool => { |
343
|
|
|
|
|
|
|
accept => [ |
344
|
|
|
|
|
|
|
$ZERO, |
345
|
|
|
|
|
|
|
$ONE, |
346
|
|
|
|
|
|
|
$BOOL_OVERLOAD_TRUE, |
347
|
|
|
|
|
|
|
$BOOL_OVERLOAD_FALSE, |
348
|
|
|
|
|
|
|
$EMPTY_STRING, |
349
|
|
|
|
|
|
|
$UNDEF, |
350
|
|
|
|
|
|
|
], |
351
|
|
|
|
|
|
|
reject => [ |
352
|
|
|
|
|
|
|
$INT, |
353
|
|
|
|
|
|
|
$NEG_INT, |
354
|
|
|
|
|
|
|
$NUM, |
355
|
|
|
|
|
|
|
$NEG_NUM, |
356
|
|
|
|
|
|
|
$NUM_OVERLOAD_ZERO, |
357
|
|
|
|
|
|
|
$NUM_OVERLOAD_ONE, |
358
|
|
|
|
|
|
|
$NUM_OVERLOAD_NEG, |
359
|
|
|
|
|
|
|
$NUM_OVERLOAD_NEG_DECIMAL, |
360
|
|
|
|
|
|
|
$NUM_OVERLOAD_DECIMAL, |
361
|
|
|
|
|
|
|
$STRING, |
362
|
|
|
|
|
|
|
$NUM_IN_STRING, |
363
|
|
|
|
|
|
|
$STR_OVERLOAD_EMPTY, |
364
|
|
|
|
|
|
|
$STR_OVERLOAD_FULL, |
365
|
|
|
|
|
|
|
$INT_WITH_NL1, |
366
|
|
|
|
|
|
|
$INT_WITH_NL2, |
367
|
|
|
|
|
|
|
$SCALAR_REF, |
368
|
|
|
|
|
|
|
$SCALAR_REF_REF, |
369
|
|
|
|
|
|
|
$SCALAR_OVERLOAD, |
370
|
|
|
|
|
|
|
$ARRAY_REF, |
371
|
|
|
|
|
|
|
$ARRAY_OVERLOAD, |
372
|
|
|
|
|
|
|
$HASH_REF, |
373
|
|
|
|
|
|
|
$HASH_OVERLOAD, |
374
|
|
|
|
|
|
|
$CODE_REF, |
375
|
|
|
|
|
|
|
$CODE_OVERLOAD, |
376
|
|
|
|
|
|
|
$GLOB, |
377
|
|
|
|
|
|
|
$GLOB_REF, |
378
|
|
|
|
|
|
|
$GLOB_OVERLOAD, |
379
|
|
|
|
|
|
|
$GLOB_OVERLOAD_FH, |
380
|
|
|
|
|
|
|
$FH, |
381
|
|
|
|
|
|
|
$FH_OBJECT, |
382
|
|
|
|
|
|
|
$REGEX, |
383
|
|
|
|
|
|
|
$REGEX_OBJ, |
384
|
|
|
|
|
|
|
$REGEX_OVERLOAD, |
385
|
|
|
|
|
|
|
$FAKE_REGEX, |
386
|
|
|
|
|
|
|
$OBJECT, |
387
|
|
|
|
|
|
|
], |
388
|
|
|
|
|
|
|
}, |
389
|
|
|
|
|
|
|
Maybe => { |
390
|
|
|
|
|
|
|
accept => [ |
391
|
|
|
|
|
|
|
$ZERO, |
392
|
|
|
|
|
|
|
$ONE, |
393
|
|
|
|
|
|
|
$BOOL_OVERLOAD_TRUE, |
394
|
|
|
|
|
|
|
$BOOL_OVERLOAD_FALSE, |
395
|
|
|
|
|
|
|
$INT, |
396
|
|
|
|
|
|
|
$NEG_INT, |
397
|
|
|
|
|
|
|
$NUM, |
398
|
|
|
|
|
|
|
$NEG_NUM, |
399
|
|
|
|
|
|
|
$NUM_OVERLOAD_ZERO, |
400
|
|
|
|
|
|
|
$NUM_OVERLOAD_ONE, |
401
|
|
|
|
|
|
|
$NUM_OVERLOAD_NEG, |
402
|
|
|
|
|
|
|
$NUM_OVERLOAD_NEG_DECIMAL, |
403
|
|
|
|
|
|
|
$NUM_OVERLOAD_DECIMAL, |
404
|
|
|
|
|
|
|
$EMPTY_STRING, |
405
|
|
|
|
|
|
|
$STRING, |
406
|
|
|
|
|
|
|
$NUM_IN_STRING, |
407
|
|
|
|
|
|
|
$STR_OVERLOAD_EMPTY, |
408
|
|
|
|
|
|
|
$STR_OVERLOAD_FULL, |
409
|
|
|
|
|
|
|
$INT_WITH_NL1, |
410
|
|
|
|
|
|
|
$INT_WITH_NL2, |
411
|
|
|
|
|
|
|
$SCALAR_REF, |
412
|
|
|
|
|
|
|
$SCALAR_REF_REF, |
413
|
|
|
|
|
|
|
$SCALAR_OVERLOAD, |
414
|
|
|
|
|
|
|
$ARRAY_REF, |
415
|
|
|
|
|
|
|
$ARRAY_OVERLOAD, |
416
|
|
|
|
|
|
|
$HASH_REF, |
417
|
|
|
|
|
|
|
$HASH_OVERLOAD, |
418
|
|
|
|
|
|
|
$CODE_REF, |
419
|
|
|
|
|
|
|
$CODE_OVERLOAD, |
420
|
|
|
|
|
|
|
$GLOB, |
421
|
|
|
|
|
|
|
$GLOB_REF, |
422
|
|
|
|
|
|
|
$GLOB_OVERLOAD, |
423
|
|
|
|
|
|
|
$GLOB_OVERLOAD_FH, |
424
|
|
|
|
|
|
|
$FH, |
425
|
|
|
|
|
|
|
$FH_OBJECT, |
426
|
|
|
|
|
|
|
$REGEX, |
427
|
|
|
|
|
|
|
$REGEX_OBJ, |
428
|
|
|
|
|
|
|
$REGEX_OVERLOAD, |
429
|
|
|
|
|
|
|
$FAKE_REGEX, |
430
|
|
|
|
|
|
|
$OBJECT, |
431
|
|
|
|
|
|
|
$UNDEF, |
432
|
|
|
|
|
|
|
], |
433
|
|
|
|
|
|
|
}, |
434
|
|
|
|
|
|
|
Value => { |
435
|
|
|
|
|
|
|
accept => [ |
436
|
|
|
|
|
|
|
$ZERO, |
437
|
|
|
|
|
|
|
$ONE, |
438
|
|
|
|
|
|
|
$INT, |
439
|
|
|
|
|
|
|
$NEG_INT, |
440
|
|
|
|
|
|
|
$NUM, |
441
|
|
|
|
|
|
|
$NEG_NUM, |
442
|
|
|
|
|
|
|
$EMPTY_STRING, |
443
|
|
|
|
|
|
|
$STRING, |
444
|
|
|
|
|
|
|
$NUM_IN_STRING, |
445
|
|
|
|
|
|
|
$INT_WITH_NL1, |
446
|
|
|
|
|
|
|
$INT_WITH_NL2, |
447
|
|
|
|
|
|
|
$GLOB, |
448
|
|
|
|
|
|
|
], |
449
|
|
|
|
|
|
|
reject => [ |
450
|
|
|
|
|
|
|
$BOOL_OVERLOAD_TRUE, |
451
|
|
|
|
|
|
|
$BOOL_OVERLOAD_FALSE, |
452
|
|
|
|
|
|
|
$STR_OVERLOAD_EMPTY, |
453
|
|
|
|
|
|
|
$STR_OVERLOAD_FULL, |
454
|
|
|
|
|
|
|
$NUM_OVERLOAD_ZERO, |
455
|
|
|
|
|
|
|
$NUM_OVERLOAD_ONE, |
456
|
|
|
|
|
|
|
$NUM_OVERLOAD_NEG, |
457
|
|
|
|
|
|
|
$NUM_OVERLOAD_NEG_DECIMAL, |
458
|
|
|
|
|
|
|
$NUM_OVERLOAD_DECIMAL, |
459
|
|
|
|
|
|
|
$SCALAR_REF, |
460
|
|
|
|
|
|
|
$SCALAR_REF_REF, |
461
|
|
|
|
|
|
|
$SCALAR_OVERLOAD, |
462
|
|
|
|
|
|
|
$ARRAY_REF, |
463
|
|
|
|
|
|
|
$ARRAY_OVERLOAD, |
464
|
|
|
|
|
|
|
$HASH_REF, |
465
|
|
|
|
|
|
|
$HASH_OVERLOAD, |
466
|
|
|
|
|
|
|
$CODE_REF, |
467
|
|
|
|
|
|
|
$CODE_OVERLOAD, |
468
|
|
|
|
|
|
|
$GLOB_REF, |
469
|
|
|
|
|
|
|
$GLOB_OVERLOAD, |
470
|
|
|
|
|
|
|
$GLOB_OVERLOAD_FH, |
471
|
|
|
|
|
|
|
$FH, |
472
|
|
|
|
|
|
|
$FH_OBJECT, |
473
|
|
|
|
|
|
|
$REGEX, |
474
|
|
|
|
|
|
|
$REGEX_OBJ, |
475
|
|
|
|
|
|
|
$REGEX_OVERLOAD, |
476
|
|
|
|
|
|
|
$FAKE_REGEX, |
477
|
|
|
|
|
|
|
$OBJECT, |
478
|
|
|
|
|
|
|
$UNDEF, |
479
|
|
|
|
|
|
|
], |
480
|
|
|
|
|
|
|
}, |
481
|
|
|
|
|
|
|
Ref => { |
482
|
|
|
|
|
|
|
accept => [ |
483
|
|
|
|
|
|
|
$BOOL_OVERLOAD_TRUE, |
484
|
|
|
|
|
|
|
$BOOL_OVERLOAD_FALSE, |
485
|
|
|
|
|
|
|
$STR_OVERLOAD_EMPTY, |
486
|
|
|
|
|
|
|
$STR_OVERLOAD_FULL, |
487
|
|
|
|
|
|
|
$NUM_OVERLOAD_ZERO, |
488
|
|
|
|
|
|
|
$NUM_OVERLOAD_ONE, |
489
|
|
|
|
|
|
|
$NUM_OVERLOAD_NEG, |
490
|
|
|
|
|
|
|
$NUM_OVERLOAD_NEG_DECIMAL, |
491
|
|
|
|
|
|
|
$NUM_OVERLOAD_DECIMAL, |
492
|
|
|
|
|
|
|
$SCALAR_REF, |
493
|
|
|
|
|
|
|
$SCALAR_REF_REF, |
494
|
|
|
|
|
|
|
$SCALAR_OVERLOAD, |
495
|
|
|
|
|
|
|
$ARRAY_REF, |
496
|
|
|
|
|
|
|
$ARRAY_OVERLOAD, |
497
|
|
|
|
|
|
|
$HASH_REF, |
498
|
|
|
|
|
|
|
$HASH_OVERLOAD, |
499
|
|
|
|
|
|
|
$CODE_REF, |
500
|
|
|
|
|
|
|
$CODE_OVERLOAD, |
501
|
|
|
|
|
|
|
$GLOB_REF, |
502
|
|
|
|
|
|
|
$GLOB_OVERLOAD, |
503
|
|
|
|
|
|
|
$GLOB_OVERLOAD_FH, |
504
|
|
|
|
|
|
|
$FH, |
505
|
|
|
|
|
|
|
$FH_OBJECT, |
506
|
|
|
|
|
|
|
$REGEX, |
507
|
|
|
|
|
|
|
$REGEX_OBJ, |
508
|
|
|
|
|
|
|
$REGEX_OVERLOAD, |
509
|
|
|
|
|
|
|
$FAKE_REGEX, |
510
|
|
|
|
|
|
|
$OBJECT, |
511
|
|
|
|
|
|
|
], |
512
|
|
|
|
|
|
|
reject => [ |
513
|
|
|
|
|
|
|
$ZERO, |
514
|
|
|
|
|
|
|
$ONE, |
515
|
|
|
|
|
|
|
$INT, |
516
|
|
|
|
|
|
|
$NEG_INT, |
517
|
|
|
|
|
|
|
$NUM, |
518
|
|
|
|
|
|
|
$NEG_NUM, |
519
|
|
|
|
|
|
|
$EMPTY_STRING, |
520
|
|
|
|
|
|
|
$STRING, |
521
|
|
|
|
|
|
|
$NUM_IN_STRING, |
522
|
|
|
|
|
|
|
$INT_WITH_NL1, |
523
|
|
|
|
|
|
|
$INT_WITH_NL2, |
524
|
|
|
|
|
|
|
$GLOB, |
525
|
|
|
|
|
|
|
$UNDEF, |
526
|
|
|
|
|
|
|
], |
527
|
|
|
|
|
|
|
}, |
528
|
|
|
|
|
|
|
Num => { |
529
|
|
|
|
|
|
|
accept => [ |
530
|
|
|
|
|
|
|
$ZERO, |
531
|
|
|
|
|
|
|
$ONE, |
532
|
|
|
|
|
|
|
$INT, |
533
|
|
|
|
|
|
|
$NEG_INT, |
534
|
|
|
|
|
|
|
$NUM, |
535
|
|
|
|
|
|
|
$NEG_NUM, |
536
|
|
|
|
|
|
|
$NUM_OVERLOAD_ZERO, |
537
|
|
|
|
|
|
|
$NUM_OVERLOAD_ONE, |
538
|
|
|
|
|
|
|
$NUM_OVERLOAD_NEG, |
539
|
|
|
|
|
|
|
$NUM_OVERLOAD_NEG_DECIMAL, |
540
|
|
|
|
|
|
|
$NUM_OVERLOAD_DECIMAL, |
541
|
|
|
|
|
|
|
qw( |
542
|
|
|
|
|
|
|
1e10 |
543
|
|
|
|
|
|
|
1e-10 |
544
|
|
|
|
|
|
|
1.23456e10 |
545
|
|
|
|
|
|
|
1.23456e-10 |
546
|
|
|
|
|
|
|
1e10 |
547
|
|
|
|
|
|
|
1e-10 |
548
|
|
|
|
|
|
|
1.23456e10 |
549
|
|
|
|
|
|
|
1.23456e-10 |
550
|
|
|
|
|
|
|
-1e10 |
551
|
|
|
|
|
|
|
-1e-10 |
552
|
|
|
|
|
|
|
-1.23456e10 |
553
|
|
|
|
|
|
|
-1.23456e-10 |
554
|
|
|
|
|
|
|
-1e10 |
555
|
|
|
|
|
|
|
-1e-10 |
556
|
|
|
|
|
|
|
-1.23456e10 |
557
|
|
|
|
|
|
|
-1.23456e-10 |
558
|
|
|
|
|
|
|
-1e+10 |
559
|
|
|
|
|
|
|
1E10 |
560
|
|
|
|
|
|
|
), |
561
|
|
|
|
|
|
|
], |
562
|
|
|
|
|
|
|
reject => [ |
563
|
|
|
|
|
|
|
$BOOL_OVERLOAD_TRUE, |
564
|
|
|
|
|
|
|
$BOOL_OVERLOAD_FALSE, |
565
|
|
|
|
|
|
|
$EMPTY_STRING, |
566
|
|
|
|
|
|
|
$STRING, |
567
|
|
|
|
|
|
|
$NUM_IN_STRING, |
568
|
|
|
|
|
|
|
$STR_OVERLOAD_EMPTY, |
569
|
|
|
|
|
|
|
$STR_OVERLOAD_FULL, |
570
|
|
|
|
|
|
|
$SCALAR_REF, |
571
|
|
|
|
|
|
|
$SCALAR_REF_REF, |
572
|
|
|
|
|
|
|
$SCALAR_OVERLOAD, |
573
|
|
|
|
|
|
|
$ARRAY_REF, |
574
|
|
|
|
|
|
|
$ARRAY_OVERLOAD, |
575
|
|
|
|
|
|
|
$HASH_REF, |
576
|
|
|
|
|
|
|
$HASH_OVERLOAD, |
577
|
|
|
|
|
|
|
$CODE_REF, |
578
|
|
|
|
|
|
|
$CODE_OVERLOAD, |
579
|
|
|
|
|
|
|
$GLOB, |
580
|
|
|
|
|
|
|
$GLOB_REF, |
581
|
|
|
|
|
|
|
$GLOB_OVERLOAD, |
582
|
|
|
|
|
|
|
$GLOB_OVERLOAD_FH, |
583
|
|
|
|
|
|
|
$FH, |
584
|
|
|
|
|
|
|
$FH_OBJECT, |
585
|
|
|
|
|
|
|
$INT_WITH_NL1, |
586
|
|
|
|
|
|
|
$INT_WITH_NL2, |
587
|
|
|
|
|
|
|
$REGEX, |
588
|
|
|
|
|
|
|
$REGEX_OBJ, |
589
|
|
|
|
|
|
|
$REGEX_OVERLOAD, |
590
|
|
|
|
|
|
|
$FAKE_REGEX, |
591
|
|
|
|
|
|
|
$OBJECT, |
592
|
|
|
|
|
|
|
$UNDEF, |
593
|
|
|
|
|
|
|
], |
594
|
|
|
|
|
|
|
}, |
595
|
|
|
|
|
|
|
Int => { |
596
|
|
|
|
|
|
|
accept => [ |
597
|
|
|
|
|
|
|
$ZERO, |
598
|
|
|
|
|
|
|
$ONE, |
599
|
|
|
|
|
|
|
$INT, |
600
|
|
|
|
|
|
|
$NEG_INT, |
601
|
|
|
|
|
|
|
$NUM_OVERLOAD_ZERO, |
602
|
|
|
|
|
|
|
$NUM_OVERLOAD_ONE, |
603
|
|
|
|
|
|
|
$NUM_OVERLOAD_NEG, |
604
|
|
|
|
|
|
|
qw( |
605
|
|
|
|
|
|
|
1e20 |
606
|
|
|
|
|
|
|
1e100 |
607
|
|
|
|
|
|
|
-1e10 |
608
|
|
|
|
|
|
|
-1e+10 |
609
|
|
|
|
|
|
|
1E20 |
610
|
|
|
|
|
|
|
), |
611
|
|
|
|
|
|
|
], |
612
|
|
|
|
|
|
|
reject => [ |
613
|
|
|
|
|
|
|
$BOOL_OVERLOAD_TRUE, |
614
|
|
|
|
|
|
|
$BOOL_OVERLOAD_FALSE, |
615
|
|
|
|
|
|
|
$NUM, |
616
|
|
|
|
|
|
|
$NEG_NUM, |
617
|
|
|
|
|
|
|
$NUM_OVERLOAD_NEG_DECIMAL, |
618
|
|
|
|
|
|
|
$NUM_OVERLOAD_DECIMAL, |
619
|
|
|
|
|
|
|
$EMPTY_STRING, |
620
|
|
|
|
|
|
|
$STRING, |
621
|
|
|
|
|
|
|
$NUM_IN_STRING, |
622
|
|
|
|
|
|
|
$STR_OVERLOAD_EMPTY, |
623
|
|
|
|
|
|
|
$STR_OVERLOAD_FULL, |
624
|
|
|
|
|
|
|
$INT_WITH_NL1, |
625
|
|
|
|
|
|
|
$INT_WITH_NL2, |
626
|
|
|
|
|
|
|
$SCALAR_REF, |
627
|
|
|
|
|
|
|
$SCALAR_REF_REF, |
628
|
|
|
|
|
|
|
$SCALAR_OVERLOAD, |
629
|
|
|
|
|
|
|
$ARRAY_REF, |
630
|
|
|
|
|
|
|
$ARRAY_OVERLOAD, |
631
|
|
|
|
|
|
|
$HASH_REF, |
632
|
|
|
|
|
|
|
$HASH_OVERLOAD, |
633
|
|
|
|
|
|
|
$CODE_REF, |
634
|
|
|
|
|
|
|
$CODE_OVERLOAD, |
635
|
|
|
|
|
|
|
$GLOB, |
636
|
|
|
|
|
|
|
$GLOB_REF, |
637
|
|
|
|
|
|
|
$GLOB_OVERLOAD, |
638
|
|
|
|
|
|
|
$GLOB_OVERLOAD_FH, |
639
|
|
|
|
|
|
|
$FH, |
640
|
|
|
|
|
|
|
$FH_OBJECT, |
641
|
|
|
|
|
|
|
$REGEX, |
642
|
|
|
|
|
|
|
$REGEX_OBJ, |
643
|
|
|
|
|
|
|
$REGEX_OVERLOAD, |
644
|
|
|
|
|
|
|
$FAKE_REGEX, |
645
|
|
|
|
|
|
|
$OBJECT, |
646
|
|
|
|
|
|
|
$UNDEF, |
647
|
|
|
|
|
|
|
qw( |
648
|
|
|
|
|
|
|
1e-10 |
649
|
|
|
|
|
|
|
-1e-10 |
650
|
|
|
|
|
|
|
1.23456e10 |
651
|
|
|
|
|
|
|
1.23456e-10 |
652
|
|
|
|
|
|
|
-1.23456e10 |
653
|
|
|
|
|
|
|
-1.23456e-10 |
654
|
|
|
|
|
|
|
-1.23456e+10 |
655
|
|
|
|
|
|
|
), |
656
|
|
|
|
|
|
|
], |
657
|
|
|
|
|
|
|
}, |
658
|
|
|
|
|
|
|
Str => { |
659
|
|
|
|
|
|
|
accept => [ |
660
|
|
|
|
|
|
|
$ZERO, |
661
|
|
|
|
|
|
|
$ONE, |
662
|
|
|
|
|
|
|
$INT, |
663
|
|
|
|
|
|
|
$NEG_INT, |
664
|
|
|
|
|
|
|
$NUM, |
665
|
|
|
|
|
|
|
$NEG_NUM, |
666
|
|
|
|
|
|
|
$EMPTY_STRING, |
667
|
|
|
|
|
|
|
$STRING, |
668
|
|
|
|
|
|
|
$NUM_IN_STRING, |
669
|
|
|
|
|
|
|
$STR_OVERLOAD_EMPTY, |
670
|
|
|
|
|
|
|
$STR_OVERLOAD_FULL, |
671
|
|
|
|
|
|
|
$INT_WITH_NL1, |
672
|
|
|
|
|
|
|
$INT_WITH_NL2, |
673
|
|
|
|
|
|
|
], |
674
|
|
|
|
|
|
|
reject => [ |
675
|
|
|
|
|
|
|
$BOOL_OVERLOAD_TRUE, |
676
|
|
|
|
|
|
|
$BOOL_OVERLOAD_FALSE, |
677
|
|
|
|
|
|
|
$NUM_OVERLOAD_ZERO, |
678
|
|
|
|
|
|
|
$NUM_OVERLOAD_ONE, |
679
|
|
|
|
|
|
|
$NUM_OVERLOAD_NEG, |
680
|
|
|
|
|
|
|
$NUM_OVERLOAD_NEG_DECIMAL, |
681
|
|
|
|
|
|
|
$NUM_OVERLOAD_DECIMAL, |
682
|
|
|
|
|
|
|
$SCALAR_REF, |
683
|
|
|
|
|
|
|
$SCALAR_REF_REF, |
684
|
|
|
|
|
|
|
$SCALAR_OVERLOAD, |
685
|
|
|
|
|
|
|
$ARRAY_REF, |
686
|
|
|
|
|
|
|
$ARRAY_OVERLOAD, |
687
|
|
|
|
|
|
|
$HASH_REF, |
688
|
|
|
|
|
|
|
$HASH_OVERLOAD, |
689
|
|
|
|
|
|
|
$CODE_REF, |
690
|
|
|
|
|
|
|
$CODE_OVERLOAD, |
691
|
|
|
|
|
|
|
$GLOB, |
692
|
|
|
|
|
|
|
$GLOB_REF, |
693
|
|
|
|
|
|
|
$GLOB_OVERLOAD, |
694
|
|
|
|
|
|
|
$GLOB_OVERLOAD_FH, |
695
|
|
|
|
|
|
|
$FH, |
696
|
|
|
|
|
|
|
$FH_OBJECT, |
697
|
|
|
|
|
|
|
$REGEX, |
698
|
|
|
|
|
|
|
$REGEX_OBJ, |
699
|
|
|
|
|
|
|
$REGEX_OVERLOAD, |
700
|
|
|
|
|
|
|
$FAKE_REGEX, |
701
|
|
|
|
|
|
|
$OBJECT, |
702
|
|
|
|
|
|
|
$UNDEF, |
703
|
|
|
|
|
|
|
], |
704
|
|
|
|
|
|
|
}, |
705
|
|
|
|
|
|
|
ScalarRef => { |
706
|
|
|
|
|
|
|
accept => [ |
707
|
|
|
|
|
|
|
$SCALAR_REF, |
708
|
|
|
|
|
|
|
$SCALAR_REF_REF, |
709
|
|
|
|
|
|
|
$SCALAR_OVERLOAD, |
710
|
|
|
|
|
|
|
], |
711
|
|
|
|
|
|
|
reject => [ |
712
|
|
|
|
|
|
|
$ZERO, |
713
|
|
|
|
|
|
|
$ONE, |
714
|
|
|
|
|
|
|
$BOOL_OVERLOAD_TRUE, |
715
|
|
|
|
|
|
|
$BOOL_OVERLOAD_FALSE, |
716
|
|
|
|
|
|
|
$INT, |
717
|
|
|
|
|
|
|
$NEG_INT, |
718
|
|
|
|
|
|
|
$NUM, |
719
|
|
|
|
|
|
|
$NEG_NUM, |
720
|
|
|
|
|
|
|
$NUM_OVERLOAD_ZERO, |
721
|
|
|
|
|
|
|
$NUM_OVERLOAD_ONE, |
722
|
|
|
|
|
|
|
$NUM_OVERLOAD_NEG, |
723
|
|
|
|
|
|
|
$NUM_OVERLOAD_NEG_DECIMAL, |
724
|
|
|
|
|
|
|
$NUM_OVERLOAD_DECIMAL, |
725
|
|
|
|
|
|
|
$EMPTY_STRING, |
726
|
|
|
|
|
|
|
$STRING, |
727
|
|
|
|
|
|
|
$NUM_IN_STRING, |
728
|
|
|
|
|
|
|
$STR_OVERLOAD_EMPTY, |
729
|
|
|
|
|
|
|
$STR_OVERLOAD_FULL, |
730
|
|
|
|
|
|
|
$INT_WITH_NL1, |
731
|
|
|
|
|
|
|
$INT_WITH_NL2, |
732
|
|
|
|
|
|
|
$ARRAY_REF, |
733
|
|
|
|
|
|
|
$ARRAY_OVERLOAD, |
734
|
|
|
|
|
|
|
$HASH_REF, |
735
|
|
|
|
|
|
|
$HASH_OVERLOAD, |
736
|
|
|
|
|
|
|
$CODE_REF, |
737
|
|
|
|
|
|
|
$CODE_OVERLOAD, |
738
|
|
|
|
|
|
|
$GLOB, |
739
|
|
|
|
|
|
|
$GLOB_REF, |
740
|
|
|
|
|
|
|
$GLOB_OVERLOAD, |
741
|
|
|
|
|
|
|
$GLOB_OVERLOAD_FH, |
742
|
|
|
|
|
|
|
$FH, |
743
|
|
|
|
|
|
|
$FH_OBJECT, |
744
|
|
|
|
|
|
|
$REGEX, |
745
|
|
|
|
|
|
|
$REGEX_OBJ, |
746
|
|
|
|
|
|
|
$REGEX_OVERLOAD, |
747
|
|
|
|
|
|
|
$FAKE_REGEX, |
748
|
|
|
|
|
|
|
$OBJECT, |
749
|
|
|
|
|
|
|
$UNDEF, |
750
|
|
|
|
|
|
|
], |
751
|
|
|
|
|
|
|
}, |
752
|
|
|
|
|
|
|
ArrayRef => { |
753
|
|
|
|
|
|
|
accept => [ |
754
|
|
|
|
|
|
|
$ARRAY_REF, |
755
|
|
|
|
|
|
|
$ARRAY_OVERLOAD, |
756
|
|
|
|
|
|
|
], |
757
|
|
|
|
|
|
|
reject => [ |
758
|
|
|
|
|
|
|
$ZERO, |
759
|
|
|
|
|
|
|
$ONE, |
760
|
|
|
|
|
|
|
$BOOL_OVERLOAD_TRUE, |
761
|
|
|
|
|
|
|
$BOOL_OVERLOAD_FALSE, |
762
|
|
|
|
|
|
|
$INT, |
763
|
|
|
|
|
|
|
$NEG_INT, |
764
|
|
|
|
|
|
|
$NUM, |
765
|
|
|
|
|
|
|
$NEG_NUM, |
766
|
|
|
|
|
|
|
$NUM_OVERLOAD_ZERO, |
767
|
|
|
|
|
|
|
$NUM_OVERLOAD_ONE, |
768
|
|
|
|
|
|
|
$NUM_OVERLOAD_NEG, |
769
|
|
|
|
|
|
|
$NUM_OVERLOAD_NEG_DECIMAL, |
770
|
|
|
|
|
|
|
$NUM_OVERLOAD_DECIMAL, |
771
|
|
|
|
|
|
|
$EMPTY_STRING, |
772
|
|
|
|
|
|
|
$STRING, |
773
|
|
|
|
|
|
|
$NUM_IN_STRING, |
774
|
|
|
|
|
|
|
$STR_OVERLOAD_EMPTY, |
775
|
|
|
|
|
|
|
$STR_OVERLOAD_FULL, |
776
|
|
|
|
|
|
|
$INT_WITH_NL1, |
777
|
|
|
|
|
|
|
$INT_WITH_NL2, |
778
|
|
|
|
|
|
|
$SCALAR_REF, |
779
|
|
|
|
|
|
|
$SCALAR_REF_REF, |
780
|
|
|
|
|
|
|
$SCALAR_OVERLOAD, |
781
|
|
|
|
|
|
|
$HASH_REF, |
782
|
|
|
|
|
|
|
$HASH_OVERLOAD, |
783
|
|
|
|
|
|
|
$CODE_REF, |
784
|
|
|
|
|
|
|
$CODE_OVERLOAD, |
785
|
|
|
|
|
|
|
$GLOB, |
786
|
|
|
|
|
|
|
$GLOB_REF, |
787
|
|
|
|
|
|
|
$GLOB_OVERLOAD, |
788
|
|
|
|
|
|
|
$GLOB_OVERLOAD_FH, |
789
|
|
|
|
|
|
|
$FH, |
790
|
|
|
|
|
|
|
$FH_OBJECT, |
791
|
|
|
|
|
|
|
$REGEX, |
792
|
|
|
|
|
|
|
$REGEX_OBJ, |
793
|
|
|
|
|
|
|
$REGEX_OVERLOAD, |
794
|
|
|
|
|
|
|
$FAKE_REGEX, |
795
|
|
|
|
|
|
|
$OBJECT, |
796
|
|
|
|
|
|
|
$UNDEF, |
797
|
|
|
|
|
|
|
], |
798
|
|
|
|
|
|
|
}, |
799
|
|
|
|
|
|
|
HashRef => { |
800
|
|
|
|
|
|
|
accept => [ |
801
|
|
|
|
|
|
|
$HASH_REF, |
802
|
|
|
|
|
|
|
$HASH_OVERLOAD, |
803
|
|
|
|
|
|
|
], |
804
|
|
|
|
|
|
|
reject => [ |
805
|
|
|
|
|
|
|
$ZERO, |
806
|
|
|
|
|
|
|
$ONE, |
807
|
|
|
|
|
|
|
$BOOL_OVERLOAD_TRUE, |
808
|
|
|
|
|
|
|
$BOOL_OVERLOAD_FALSE, |
809
|
|
|
|
|
|
|
$INT, |
810
|
|
|
|
|
|
|
$NEG_INT, |
811
|
|
|
|
|
|
|
$NUM, |
812
|
|
|
|
|
|
|
$NEG_NUM, |
813
|
|
|
|
|
|
|
$NUM_OVERLOAD_ZERO, |
814
|
|
|
|
|
|
|
$NUM_OVERLOAD_ONE, |
815
|
|
|
|
|
|
|
$NUM_OVERLOAD_NEG, |
816
|
|
|
|
|
|
|
$NUM_OVERLOAD_NEG_DECIMAL, |
817
|
|
|
|
|
|
|
$NUM_OVERLOAD_DECIMAL, |
818
|
|
|
|
|
|
|
$EMPTY_STRING, |
819
|
|
|
|
|
|
|
$STRING, |
820
|
|
|
|
|
|
|
$NUM_IN_STRING, |
821
|
|
|
|
|
|
|
$STR_OVERLOAD_EMPTY, |
822
|
|
|
|
|
|
|
$STR_OVERLOAD_FULL, |
823
|
|
|
|
|
|
|
$INT_WITH_NL1, |
824
|
|
|
|
|
|
|
$INT_WITH_NL2, |
825
|
|
|
|
|
|
|
$SCALAR_REF, |
826
|
|
|
|
|
|
|
$SCALAR_REF_REF, |
827
|
|
|
|
|
|
|
$SCALAR_OVERLOAD, |
828
|
|
|
|
|
|
|
$ARRAY_REF, |
829
|
|
|
|
|
|
|
$ARRAY_OVERLOAD, |
830
|
|
|
|
|
|
|
$CODE_REF, |
831
|
|
|
|
|
|
|
$CODE_OVERLOAD, |
832
|
|
|
|
|
|
|
$GLOB, |
833
|
|
|
|
|
|
|
$GLOB_REF, |
834
|
|
|
|
|
|
|
$GLOB_OVERLOAD, |
835
|
|
|
|
|
|
|
$GLOB_OVERLOAD_FH, |
836
|
|
|
|
|
|
|
$FH, |
837
|
|
|
|
|
|
|
$FH_OBJECT, |
838
|
|
|
|
|
|
|
$REGEX, |
839
|
|
|
|
|
|
|
$REGEX_OBJ, |
840
|
|
|
|
|
|
|
$REGEX_OVERLOAD, |
841
|
|
|
|
|
|
|
$FAKE_REGEX, |
842
|
|
|
|
|
|
|
$OBJECT, |
843
|
|
|
|
|
|
|
$UNDEF, |
844
|
|
|
|
|
|
|
], |
845
|
|
|
|
|
|
|
}, |
846
|
|
|
|
|
|
|
CodeRef => { |
847
|
|
|
|
|
|
|
accept => [ |
848
|
|
|
|
|
|
|
$CODE_REF, |
849
|
|
|
|
|
|
|
$CODE_OVERLOAD, |
850
|
|
|
|
|
|
|
], |
851
|
|
|
|
|
|
|
reject => [ |
852
|
|
|
|
|
|
|
$ZERO, |
853
|
|
|
|
|
|
|
$ONE, |
854
|
|
|
|
|
|
|
$BOOL_OVERLOAD_TRUE, |
855
|
|
|
|
|
|
|
$BOOL_OVERLOAD_FALSE, |
856
|
|
|
|
|
|
|
$INT, |
857
|
|
|
|
|
|
|
$NEG_INT, |
858
|
|
|
|
|
|
|
$NUM, |
859
|
|
|
|
|
|
|
$NEG_NUM, |
860
|
|
|
|
|
|
|
$NUM_OVERLOAD_ZERO, |
861
|
|
|
|
|
|
|
$NUM_OVERLOAD_ONE, |
862
|
|
|
|
|
|
|
$NUM_OVERLOAD_NEG, |
863
|
|
|
|
|
|
|
$NUM_OVERLOAD_NEG_DECIMAL, |
864
|
|
|
|
|
|
|
$NUM_OVERLOAD_DECIMAL, |
865
|
|
|
|
|
|
|
$EMPTY_STRING, |
866
|
|
|
|
|
|
|
$STRING, |
867
|
|
|
|
|
|
|
$NUM_IN_STRING, |
868
|
|
|
|
|
|
|
$STR_OVERLOAD_EMPTY, |
869
|
|
|
|
|
|
|
$STR_OVERLOAD_FULL, |
870
|
|
|
|
|
|
|
$INT_WITH_NL1, |
871
|
|
|
|
|
|
|
$INT_WITH_NL2, |
872
|
|
|
|
|
|
|
$SCALAR_REF, |
873
|
|
|
|
|
|
|
$SCALAR_REF_REF, |
874
|
|
|
|
|
|
|
$SCALAR_OVERLOAD, |
875
|
|
|
|
|
|
|
$ARRAY_REF, |
876
|
|
|
|
|
|
|
$ARRAY_OVERLOAD, |
877
|
|
|
|
|
|
|
$HASH_REF, |
878
|
|
|
|
|
|
|
$HASH_OVERLOAD, |
879
|
|
|
|
|
|
|
$GLOB, |
880
|
|
|
|
|
|
|
$GLOB_REF, |
881
|
|
|
|
|
|
|
$GLOB_OVERLOAD, |
882
|
|
|
|
|
|
|
$GLOB_OVERLOAD_FH, |
883
|
|
|
|
|
|
|
$FH, |
884
|
|
|
|
|
|
|
$FH_OBJECT, |
885
|
|
|
|
|
|
|
$REGEX, |
886
|
|
|
|
|
|
|
$REGEX_OBJ, |
887
|
|
|
|
|
|
|
$REGEX_OVERLOAD, |
888
|
|
|
|
|
|
|
$FAKE_REGEX, |
889
|
|
|
|
|
|
|
$OBJECT, |
890
|
|
|
|
|
|
|
$UNDEF, |
891
|
|
|
|
|
|
|
], |
892
|
|
|
|
|
|
|
}, |
893
|
|
|
|
|
|
|
RegexpRef => { |
894
|
|
|
|
|
|
|
accept => [ |
895
|
|
|
|
|
|
|
$REGEX, |
896
|
|
|
|
|
|
|
$REGEX_OBJ, |
897
|
|
|
|
|
|
|
$REGEX_OVERLOAD, |
898
|
|
|
|
|
|
|
], |
899
|
|
|
|
|
|
|
reject => [ |
900
|
|
|
|
|
|
|
$ZERO, |
901
|
|
|
|
|
|
|
$ONE, |
902
|
|
|
|
|
|
|
$BOOL_OVERLOAD_TRUE, |
903
|
|
|
|
|
|
|
$BOOL_OVERLOAD_FALSE, |
904
|
|
|
|
|
|
|
$INT, |
905
|
|
|
|
|
|
|
$NEG_INT, |
906
|
|
|
|
|
|
|
$NUM, |
907
|
|
|
|
|
|
|
$NEG_NUM, |
908
|
|
|
|
|
|
|
$NUM_OVERLOAD_ZERO, |
909
|
|
|
|
|
|
|
$NUM_OVERLOAD_ONE, |
910
|
|
|
|
|
|
|
$NUM_OVERLOAD_NEG, |
911
|
|
|
|
|
|
|
$NUM_OVERLOAD_NEG_DECIMAL, |
912
|
|
|
|
|
|
|
$NUM_OVERLOAD_DECIMAL, |
913
|
|
|
|
|
|
|
$EMPTY_STRING, |
914
|
|
|
|
|
|
|
$STRING, |
915
|
|
|
|
|
|
|
$NUM_IN_STRING, |
916
|
|
|
|
|
|
|
$STR_OVERLOAD_EMPTY, |
917
|
|
|
|
|
|
|
$STR_OVERLOAD_FULL, |
918
|
|
|
|
|
|
|
$INT_WITH_NL1, |
919
|
|
|
|
|
|
|
$INT_WITH_NL2, |
920
|
|
|
|
|
|
|
$SCALAR_REF, |
921
|
|
|
|
|
|
|
$SCALAR_REF_REF, |
922
|
|
|
|
|
|
|
$SCALAR_OVERLOAD, |
923
|
|
|
|
|
|
|
$ARRAY_REF, |
924
|
|
|
|
|
|
|
$ARRAY_OVERLOAD, |
925
|
|
|
|
|
|
|
$HASH_REF, |
926
|
|
|
|
|
|
|
$HASH_OVERLOAD, |
927
|
|
|
|
|
|
|
$CODE_REF, |
928
|
|
|
|
|
|
|
$CODE_OVERLOAD, |
929
|
|
|
|
|
|
|
$GLOB, |
930
|
|
|
|
|
|
|
$GLOB_REF, |
931
|
|
|
|
|
|
|
$GLOB_OVERLOAD, |
932
|
|
|
|
|
|
|
$GLOB_OVERLOAD_FH, |
933
|
|
|
|
|
|
|
$FH, |
934
|
|
|
|
|
|
|
$FH_OBJECT, |
935
|
|
|
|
|
|
|
$OBJECT, |
936
|
|
|
|
|
|
|
$UNDEF, |
937
|
|
|
|
|
|
|
$FAKE_REGEX, |
938
|
|
|
|
|
|
|
], |
939
|
|
|
|
|
|
|
}, |
940
|
|
|
|
|
|
|
GlobRef => { |
941
|
|
|
|
|
|
|
accept => [ |
942
|
|
|
|
|
|
|
$GLOB_REF, |
943
|
|
|
|
|
|
|
$GLOB_OVERLOAD, |
944
|
|
|
|
|
|
|
$GLOB_OVERLOAD_FH, |
945
|
|
|
|
|
|
|
$FH, |
946
|
|
|
|
|
|
|
], |
947
|
|
|
|
|
|
|
reject => [ |
948
|
|
|
|
|
|
|
$ZERO, |
949
|
|
|
|
|
|
|
$ONE, |
950
|
|
|
|
|
|
|
$BOOL_OVERLOAD_TRUE, |
951
|
|
|
|
|
|
|
$BOOL_OVERLOAD_FALSE, |
952
|
|
|
|
|
|
|
$INT, |
953
|
|
|
|
|
|
|
$NEG_INT, |
954
|
|
|
|
|
|
|
$NUM, |
955
|
|
|
|
|
|
|
$NEG_NUM, |
956
|
|
|
|
|
|
|
$NUM_OVERLOAD_ZERO, |
957
|
|
|
|
|
|
|
$NUM_OVERLOAD_ONE, |
958
|
|
|
|
|
|
|
$NUM_OVERLOAD_NEG, |
959
|
|
|
|
|
|
|
$NUM_OVERLOAD_NEG_DECIMAL, |
960
|
|
|
|
|
|
|
$NUM_OVERLOAD_DECIMAL, |
961
|
|
|
|
|
|
|
$EMPTY_STRING, |
962
|
|
|
|
|
|
|
$STRING, |
963
|
|
|
|
|
|
|
$NUM_IN_STRING, |
964
|
|
|
|
|
|
|
$STR_OVERLOAD_EMPTY, |
965
|
|
|
|
|
|
|
$STR_OVERLOAD_FULL, |
966
|
|
|
|
|
|
|
$INT_WITH_NL1, |
967
|
|
|
|
|
|
|
$INT_WITH_NL2, |
968
|
|
|
|
|
|
|
$SCALAR_REF, |
969
|
|
|
|
|
|
|
$SCALAR_REF_REF, |
970
|
|
|
|
|
|
|
$SCALAR_OVERLOAD, |
971
|
|
|
|
|
|
|
$ARRAY_REF, |
972
|
|
|
|
|
|
|
$ARRAY_OVERLOAD, |
973
|
|
|
|
|
|
|
$HASH_REF, |
974
|
|
|
|
|
|
|
$HASH_OVERLOAD, |
975
|
|
|
|
|
|
|
$CODE_REF, |
976
|
|
|
|
|
|
|
$CODE_OVERLOAD, |
977
|
|
|
|
|
|
|
$GLOB, |
978
|
|
|
|
|
|
|
$FH_OBJECT, |
979
|
|
|
|
|
|
|
$OBJECT, |
980
|
|
|
|
|
|
|
$REGEX, |
981
|
|
|
|
|
|
|
$REGEX_OBJ, |
982
|
|
|
|
|
|
|
$REGEX_OVERLOAD, |
983
|
|
|
|
|
|
|
$FAKE_REGEX, |
984
|
|
|
|
|
|
|
$UNDEF, |
985
|
|
|
|
|
|
|
], |
986
|
|
|
|
|
|
|
}, |
987
|
|
|
|
|
|
|
FileHandle => { |
988
|
|
|
|
|
|
|
accept => [ |
989
|
|
|
|
|
|
|
$FH, |
990
|
|
|
|
|
|
|
$FH_OBJECT, |
991
|
|
|
|
|
|
|
$GLOB_OVERLOAD_FH, |
992
|
|
|
|
|
|
|
], |
993
|
|
|
|
|
|
|
reject => [ |
994
|
|
|
|
|
|
|
$ZERO, |
995
|
|
|
|
|
|
|
$ONE, |
996
|
|
|
|
|
|
|
$BOOL_OVERLOAD_TRUE, |
997
|
|
|
|
|
|
|
$BOOL_OVERLOAD_FALSE, |
998
|
|
|
|
|
|
|
$INT, |
999
|
|
|
|
|
|
|
$NEG_INT, |
1000
|
|
|
|
|
|
|
$NUM, |
1001
|
|
|
|
|
|
|
$NEG_NUM, |
1002
|
|
|
|
|
|
|
$NUM_OVERLOAD_ZERO, |
1003
|
|
|
|
|
|
|
$NUM_OVERLOAD_ONE, |
1004
|
|
|
|
|
|
|
$NUM_OVERLOAD_NEG, |
1005
|
|
|
|
|
|
|
$NUM_OVERLOAD_NEG_DECIMAL, |
1006
|
|
|
|
|
|
|
$NUM_OVERLOAD_DECIMAL, |
1007
|
|
|
|
|
|
|
$EMPTY_STRING, |
1008
|
|
|
|
|
|
|
$STRING, |
1009
|
|
|
|
|
|
|
$NUM_IN_STRING, |
1010
|
|
|
|
|
|
|
$STR_OVERLOAD_EMPTY, |
1011
|
|
|
|
|
|
|
$STR_OVERLOAD_FULL, |
1012
|
|
|
|
|
|
|
$INT_WITH_NL1, |
1013
|
|
|
|
|
|
|
$INT_WITH_NL2, |
1014
|
|
|
|
|
|
|
$SCALAR_REF, |
1015
|
|
|
|
|
|
|
$SCALAR_REF_REF, |
1016
|
|
|
|
|
|
|
$SCALAR_OVERLOAD, |
1017
|
|
|
|
|
|
|
$ARRAY_REF, |
1018
|
|
|
|
|
|
|
$ARRAY_OVERLOAD, |
1019
|
|
|
|
|
|
|
$HASH_REF, |
1020
|
|
|
|
|
|
|
$HASH_OVERLOAD, |
1021
|
|
|
|
|
|
|
$CODE_REF, |
1022
|
|
|
|
|
|
|
$CODE_OVERLOAD, |
1023
|
|
|
|
|
|
|
$GLOB, |
1024
|
|
|
|
|
|
|
$GLOB_REF, |
1025
|
|
|
|
|
|
|
$GLOB_OVERLOAD, |
1026
|
|
|
|
|
|
|
$OBJECT, |
1027
|
|
|
|
|
|
|
$REGEX, |
1028
|
|
|
|
|
|
|
$REGEX_OBJ, |
1029
|
|
|
|
|
|
|
$REGEX_OVERLOAD, |
1030
|
|
|
|
|
|
|
$FAKE_REGEX, |
1031
|
|
|
|
|
|
|
$UNDEF, |
1032
|
|
|
|
|
|
|
], |
1033
|
|
|
|
|
|
|
}, |
1034
|
|
|
|
|
|
|
Object => { |
1035
|
|
|
|
|
|
|
accept => [ |
1036
|
|
|
|
|
|
|
$BOOL_OVERLOAD_TRUE, |
1037
|
|
|
|
|
|
|
$BOOL_OVERLOAD_FALSE, |
1038
|
|
|
|
|
|
|
$STR_OVERLOAD_EMPTY, |
1039
|
|
|
|
|
|
|
$STR_OVERLOAD_FULL, |
1040
|
|
|
|
|
|
|
$NUM_OVERLOAD_ZERO, |
1041
|
|
|
|
|
|
|
$NUM_OVERLOAD_ONE, |
1042
|
|
|
|
|
|
|
$NUM_OVERLOAD_NEG, |
1043
|
|
|
|
|
|
|
$NUM_OVERLOAD_NEG_DECIMAL, |
1044
|
|
|
|
|
|
|
$NUM_OVERLOAD_DECIMAL, |
1045
|
|
|
|
|
|
|
$CODE_OVERLOAD, |
1046
|
|
|
|
|
|
|
$FH_OBJECT, |
1047
|
|
|
|
|
|
|
$REGEX, |
1048
|
|
|
|
|
|
|
$REGEX_OBJ, |
1049
|
|
|
|
|
|
|
$REGEX_OVERLOAD, |
1050
|
|
|
|
|
|
|
$FAKE_REGEX, |
1051
|
|
|
|
|
|
|
$GLOB_OVERLOAD, |
1052
|
|
|
|
|
|
|
$GLOB_OVERLOAD_FH, |
1053
|
|
|
|
|
|
|
$SCALAR_OVERLOAD, |
1054
|
|
|
|
|
|
|
$ARRAY_OVERLOAD, |
1055
|
|
|
|
|
|
|
$HASH_OVERLOAD, |
1056
|
|
|
|
|
|
|
$OBJECT, |
1057
|
|
|
|
|
|
|
], |
1058
|
|
|
|
|
|
|
reject => [ |
1059
|
|
|
|
|
|
|
$ZERO, |
1060
|
|
|
|
|
|
|
$ONE, |
1061
|
|
|
|
|
|
|
$INT, |
1062
|
|
|
|
|
|
|
$NEG_INT, |
1063
|
|
|
|
|
|
|
$NUM, |
1064
|
|
|
|
|
|
|
$NEG_NUM, |
1065
|
|
|
|
|
|
|
$EMPTY_STRING, |
1066
|
|
|
|
|
|
|
$STRING, |
1067
|
|
|
|
|
|
|
$NUM_IN_STRING, |
1068
|
|
|
|
|
|
|
$INT_WITH_NL1, |
1069
|
|
|
|
|
|
|
$INT_WITH_NL2, |
1070
|
|
|
|
|
|
|
$SCALAR_REF, |
1071
|
|
|
|
|
|
|
$SCALAR_REF_REF, |
1072
|
|
|
|
|
|
|
$ARRAY_REF, |
1073
|
|
|
|
|
|
|
$HASH_REF, |
1074
|
|
|
|
|
|
|
$CODE_REF, |
1075
|
|
|
|
|
|
|
$GLOB, |
1076
|
|
|
|
|
|
|
$GLOB_REF, |
1077
|
|
|
|
|
|
|
$FH, |
1078
|
|
|
|
|
|
|
$UNDEF, |
1079
|
|
|
|
|
|
|
], |
1080
|
|
|
|
|
|
|
}, |
1081
|
|
|
|
|
|
|
ClassName => { |
1082
|
|
|
|
|
|
|
accept => [ |
1083
|
|
|
|
|
|
|
$CLASS_NAME, |
1084
|
|
|
|
|
|
|
$STR_OVERLOAD_CLASS_NAME, |
1085
|
|
|
|
|
|
|
], |
1086
|
|
|
|
|
|
|
reject => [ |
1087
|
|
|
|
|
|
|
$ZERO, |
1088
|
|
|
|
|
|
|
$ONE, |
1089
|
|
|
|
|
|
|
$BOOL_OVERLOAD_TRUE, |
1090
|
|
|
|
|
|
|
$BOOL_OVERLOAD_FALSE, |
1091
|
|
|
|
|
|
|
$INT, |
1092
|
|
|
|
|
|
|
$NEG_INT, |
1093
|
|
|
|
|
|
|
$NUM, |
1094
|
|
|
|
|
|
|
$NEG_NUM, |
1095
|
|
|
|
|
|
|
$NUM_OVERLOAD_ZERO, |
1096
|
|
|
|
|
|
|
$NUM_OVERLOAD_ONE, |
1097
|
|
|
|
|
|
|
$NUM_OVERLOAD_NEG, |
1098
|
|
|
|
|
|
|
$NUM_OVERLOAD_NEG_DECIMAL, |
1099
|
|
|
|
|
|
|
$NUM_OVERLOAD_DECIMAL, |
1100
|
|
|
|
|
|
|
$EMPTY_STRING, |
1101
|
|
|
|
|
|
|
$STRING, |
1102
|
|
|
|
|
|
|
$NUM_IN_STRING, |
1103
|
|
|
|
|
|
|
$STR_OVERLOAD_EMPTY, |
1104
|
|
|
|
|
|
|
$STR_OVERLOAD_FULL, |
1105
|
|
|
|
|
|
|
$INT_WITH_NL1, |
1106
|
|
|
|
|
|
|
$INT_WITH_NL2, |
1107
|
|
|
|
|
|
|
$SCALAR_REF, |
1108
|
|
|
|
|
|
|
$SCALAR_REF_REF, |
1109
|
|
|
|
|
|
|
$SCALAR_OVERLOAD, |
1110
|
|
|
|
|
|
|
$ARRAY_REF, |
1111
|
|
|
|
|
|
|
$ARRAY_OVERLOAD, |
1112
|
|
|
|
|
|
|
$HASH_REF, |
1113
|
|
|
|
|
|
|
$HASH_OVERLOAD, |
1114
|
|
|
|
|
|
|
$CODE_REF, |
1115
|
|
|
|
|
|
|
$CODE_OVERLOAD, |
1116
|
|
|
|
|
|
|
$GLOB, |
1117
|
|
|
|
|
|
|
$GLOB_REF, |
1118
|
|
|
|
|
|
|
$GLOB_OVERLOAD, |
1119
|
|
|
|
|
|
|
$GLOB_OVERLOAD_FH, |
1120
|
|
|
|
|
|
|
$FH, |
1121
|
|
|
|
|
|
|
$FH_OBJECT, |
1122
|
|
|
|
|
|
|
$REGEX, |
1123
|
|
|
|
|
|
|
$REGEX_OBJ, |
1124
|
|
|
|
|
|
|
$REGEX_OVERLOAD, |
1125
|
|
|
|
|
|
|
$FAKE_REGEX, |
1126
|
|
|
|
|
|
|
$OBJECT, |
1127
|
|
|
|
|
|
|
$UNDEF, |
1128
|
|
|
|
|
|
|
], |
1129
|
|
|
|
|
|
|
}, |
1130
|
|
|
|
|
|
|
}; |
1131
|
|
|
|
|
|
|
} |
1132
|
|
|
|
|
|
|
|
1133
|
|
|
|
|
|
|
my $type = shift; |
1134
|
|
|
|
|
|
|
my $tests = shift; |
1135
|
|
|
|
|
|
|
my $describer = shift || \&describe; |
1136
|
|
|
|
|
|
|
|
1137
|
|
|
|
|
|
|
local $Test::Builder::Level = $Test::Builder::Level + 1; |
1138
|
|
|
|
|
|
|
|
1139
|
|
|
|
|
|
|
$type = t($type) unless blessed $type; |
1140
|
|
|
|
|
|
|
|
1141
|
|
|
|
|
|
|
subtest( |
1142
|
|
|
|
|
|
|
( $type->name || '<anon>' ), |
1143
|
|
|
|
|
|
|
sub { |
1144
|
|
|
|
|
|
|
try { |
1145
|
|
|
|
|
|
|
my $not_inlined = $type->_constraint_with_parents; |
1146
|
|
|
|
|
|
|
|
1147
|
|
|
|
|
|
|
my $inlined; |
1148
|
|
|
|
|
|
|
if ( $type->can_be_inlined ) { |
1149
|
|
|
|
|
|
|
$inlined = $type->_generated_inline_sub; |
1150
|
|
|
|
|
|
|
} |
1151
|
|
|
|
|
|
|
|
1152
|
|
|
|
|
|
|
for my $accept ( @{ $tests->{accept} || [] } ) { |
1153
|
|
|
|
|
|
|
my $described = $describer->($accept); |
1154
|
|
|
|
|
|
|
subtest( |
1155
|
|
|
|
|
|
|
"accepts $described", |
1156
|
|
|
|
|
|
|
sub { |
1157
|
|
|
|
|
|
|
ok( |
1158
|
|
|
|
|
|
|
$type->value_is_valid($accept), |
1159
|
|
|
|
|
|
|
'using ->value_is_valid' |
1160
|
|
|
|
|
|
|
); |
1161
|
|
|
|
|
|
|
is( |
1162
|
|
|
|
|
|
|
exception { $type->($accept) }, |
1163
|
|
|
|
|
|
|
undef, |
1164
|
|
|
|
|
|
|
'using subref overloading' |
1165
|
|
|
|
|
|
|
); |
1166
|
74
|
|
|
74
|
1
|
127313
|
ok( |
1167
|
74
|
|
|
|
|
145
|
$not_inlined->($accept), |
1168
|
74
|
|
100
|
|
|
423
|
'using non-inlined constraint' |
1169
|
|
|
|
|
|
|
); |
1170
|
74
|
|
|
|
|
178
|
if ($inlined) { |
1171
|
|
|
|
|
|
|
ok( |
1172
|
74
|
100
|
|
|
|
409
|
$inlined->($accept), |
1173
|
|
|
|
|
|
|
'using inlined constraint' |
1174
|
|
|
|
|
|
|
); |
1175
|
|
|
|
|
|
|
} |
1176
|
|
|
|
|
|
|
} |
1177
|
|
|
|
|
|
|
); |
1178
|
74
|
|
|
|
|
3312
|
} |
1179
|
|
|
|
|
|
|
|
1180
|
74
|
|
|
|
|
133
|
for my $reject ( @{ $tests->{reject} || [] } ) { |
1181
|
74
|
100
|
|
|
|
199
|
my $described = $describer->($reject); |
1182
|
70
|
|
|
|
|
487
|
subtest( |
1183
|
|
|
|
|
|
|
"rejects $described", |
1184
|
|
|
|
|
|
|
sub { |
1185
|
74
|
100
|
|
|
|
4385
|
ok( |
|
74
|
|
|
|
|
322
|
|
1186
|
602
|
|
|
|
|
835501
|
!$type->value_is_valid($reject), |
1187
|
|
|
|
|
|
|
'using ->value_is_valid' |
1188
|
|
|
|
|
|
|
); |
1189
|
|
|
|
|
|
|
|
1190
|
602
|
|
|
|
|
473474
|
# I don't love this test, but there's no way to know the |
1191
|
|
|
|
|
|
|
# exact content of each type's validation failure |
1192
|
|
|
|
|
|
|
# exception. We can, however, reasonably assume (I think) |
1193
|
|
|
|
|
|
|
# that the exception thrown will include a trace starting |
1194
|
|
|
|
|
|
|
# with Specio::Exception. |
1195
|
602
|
|
|
|
|
35744
|
like( |
1196
|
|
|
|
|
|
|
exception { $type->($reject) }, |
1197
|
602
|
|
|
|
|
228748
|
qr/\QTrace begun at Specio::Exception->new/, |
1198
|
|
|
|
|
|
|
'using subref overloading' |
1199
|
602
|
|
|
|
|
340674
|
); |
1200
|
|
|
|
|
|
|
if ($inlined) { |
1201
|
|
|
|
|
|
|
ok( |
1202
|
|
|
|
|
|
|
!$inlined->($reject), |
1203
|
602
|
100
|
|
|
|
217299
|
'using inlined constraint' |
1204
|
572
|
|
|
|
|
1655
|
); |
1205
|
|
|
|
|
|
|
} |
1206
|
|
|
|
|
|
|
} |
1207
|
|
|
|
|
|
|
); |
1208
|
|
|
|
|
|
|
} |
1209
|
|
|
|
|
|
|
} |
1210
|
602
|
|
|
|
|
4215
|
catch { |
1211
|
|
|
|
|
|
|
fail('No exception in test_constraint'); |
1212
|
|
|
|
|
|
|
diag($_); |
1213
|
74
|
100
|
|
|
|
103554
|
}; |
|
74
|
|
|
|
|
389
|
|
1214
|
2237
|
|
|
|
|
3384741
|
} |
1215
|
|
|
|
|
|
|
); |
1216
|
|
|
|
|
|
|
} |
1217
|
|
|
|
|
|
|
|
1218
|
2237
|
|
|
|
|
1727772
|
my $val = shift; |
1219
|
|
|
|
|
|
|
|
1220
|
|
|
|
|
|
|
return 'undef' unless defined $val; |
1221
|
|
|
|
|
|
|
|
1222
|
|
|
|
|
|
|
if ( !ref $val ) { |
1223
|
|
|
|
|
|
|
return q{''} if $val eq q{}; |
1224
|
|
|
|
|
|
|
|
1225
|
|
|
|
|
|
|
return looks_like_number($val) |
1226
|
|
|
|
|
|
|
&& $val !~ /\n/ ? $val : Specio::Helpers::perlstring($val); |
1227
|
|
|
|
|
|
|
} |
1228
|
|
|
|
|
|
|
|
1229
|
2237
|
|
|
|
|
129207
|
return 'open filehandle' |
1230
|
2237
|
|
|
|
|
845441
|
if openhandle $val && !blessed $val; |
1231
|
|
|
|
|
|
|
|
1232
|
|
|
|
|
|
|
if ( blessed $val ) { |
1233
|
2237
|
100
|
|
|
|
1071233
|
my $desc = ( ref $val ) . ' object'; |
1234
|
2053
|
|
|
|
|
7466
|
if ( $val->isa('_T::StrOverload') ) { |
1235
|
|
|
|
|
|
|
$desc .= ' (' . describe("$val") . ')'; |
1236
|
|
|
|
|
|
|
} |
1237
|
|
|
|
|
|
|
elsif ( $val->isa('_T::BoolOverload') ) { |
1238
|
|
|
|
|
|
|
$desc .= ' (' . ( $val ? 'true' : 'false' ) . ')'; |
1239
|
|
|
|
|
|
|
} |
1240
|
2237
|
|
|
|
|
16458
|
elsif ( $val->isa('_T::NumOverload') ) { |
1241
|
|
|
|
|
|
|
$desc .= ' (' . describe( ${$val} ) . ')'; |
1242
|
|
|
|
|
|
|
} |
1243
|
|
|
|
|
|
|
|
1244
|
0
|
|
|
|
|
0
|
return $desc; |
1245
|
0
|
|
|
|
|
0
|
} |
1246
|
74
|
|
|
74
|
|
58290
|
else { |
1247
|
|
|
|
|
|
|
return ( ref $val ) . ' reference'; |
1248
|
74
|
|
100
|
|
|
351
|
} |
1249
|
|
|
|
|
|
|
} |
1250
|
|
|
|
|
|
|
|
1251
|
|
|
|
|
|
|
1; |
1252
|
5256
|
|
|
5256
|
1
|
341340
|
|
1253
|
|
|
|
|
|
|
# ABSTRACT: Test helpers for Specio |
1254
|
5256
|
100
|
|
|
|
11618
|
|
1255
|
|
|
|
|
|
|
|
1256
|
5157
|
100
|
|
|
|
11373
|
=pod |
1257
|
2372
|
100
|
|
|
|
8009
|
|
1258
|
|
|
|
|
|
|
=encoding UTF-8 |
1259
|
2168
|
100
|
100
|
|
|
18212
|
|
1260
|
|
|
|
|
|
|
=head1 NAME |
1261
|
|
|
|
|
|
|
|
1262
|
|
|
|
|
|
|
Test::Specio - Test helpers for Specio |
1263
|
2785
|
100
|
100
|
|
|
9232
|
|
1264
|
|
|
|
|
|
|
=head1 VERSION |
1265
|
|
|
|
|
|
|
|
1266
|
2688
|
100
|
|
|
|
7845
|
version 0.48 |
1267
|
2071
|
|
|
|
|
4463
|
|
1268
|
2071
|
100
|
|
|
|
14788
|
=head1 SYNOPSIS |
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
1269
|
204
|
|
|
|
|
903
|
|
1270
|
|
|
|
|
|
|
use Test::Specio qw( test_constraint :vars ); |
1271
|
|
|
|
|
|
|
|
1272
|
194
|
100
|
|
|
|
836
|
test_constraint( |
1273
|
|
|
|
|
|
|
t('Foo'), { |
1274
|
|
|
|
|
|
|
accept => [ 'foo', 'bar' ], |
1275
|
485
|
|
|
|
|
753
|
reject => [ 42, {}, $EMPTY_STRING, $HASH_REF ], |
|
485
|
|
|
|
|
1628
|
|
1276
|
|
|
|
|
|
|
} |
1277
|
|
|
|
|
|
|
); |
1278
|
2071
|
|
|
|
|
6208
|
|
1279
|
|
|
|
|
|
|
=head1 DESCRIPTION |
1280
|
|
|
|
|
|
|
|
1281
|
617
|
|
|
|
|
2110
|
This package provides some helper functions and variables for testing Specio |
1282
|
|
|
|
|
|
|
types. |
1283
|
|
|
|
|
|
|
|
1284
|
|
|
|
|
|
|
=head1 EXPORTS |
1285
|
|
|
|
|
|
|
|
1286
|
|
|
|
|
|
|
This module provides the following exports: |
1287
|
|
|
|
|
|
|
|
1288
|
|
|
|
|
|
|
=head2 test_constraint( $type, $tests, [ $describer ] ) |
1289
|
|
|
|
|
|
|
|
1290
|
|
|
|
|
|
|
This subroutine accepts two arguments. The first should be a Specio type |
1291
|
|
|
|
|
|
|
object. The second is hashref which can contain the keys C<accept> and |
1292
|
|
|
|
|
|
|
C<reject>. Each key should contain an arrayref of values which the type accepts |
1293
|
|
|
|
|
|
|
or rejects. |
1294
|
|
|
|
|
|
|
|
1295
|
|
|
|
|
|
|
The third argument is optional. This is a sub reference which will be called to |
1296
|
|
|
|
|
|
|
generate a description of the value being tested. This defaults to calling this |
1297
|
|
|
|
|
|
|
package's C<describe> sub, but you can provide your own. |
1298
|
|
|
|
|
|
|
|
1299
|
|
|
|
|
|
|
=head2 describe($value) |
1300
|
|
|
|
|
|
|
|
1301
|
|
|
|
|
|
|
Given a value, this subroutine returns a string describing that value in a |
1302
|
|
|
|
|
|
|
useful way for test output. It know about the various classes used for the |
1303
|
|
|
|
|
|
|
variables exported by this package and will do something intelligent when such |
1304
|
|
|
|
|
|
|
a variable. |
1305
|
|
|
|
|
|
|
|
1306
|
|
|
|
|
|
|
=head2 builtins_tests( $GLOB, $GLOB_OVERLOAD, $GLOB_OVERLOAD_FH ) |
1307
|
|
|
|
|
|
|
|
1308
|
|
|
|
|
|
|
This subroutine returns a hashref containing test variables for all builtin |
1309
|
|
|
|
|
|
|
types. The hashref has a form like this: |
1310
|
|
|
|
|
|
|
|
1311
|
|
|
|
|
|
|
{ |
1312
|
|
|
|
|
|
|
Bool => { |
1313
|
|
|
|
|
|
|
accept => [ |
1314
|
|
|
|
|
|
|
$ZERO, |
1315
|
|
|
|
|
|
|
$ONE, |
1316
|
|
|
|
|
|
|
$BOOL_OVERLOAD_TRUE, |
1317
|
|
|
|
|
|
|
$BOOL_OVERLOAD_FALSE, |
1318
|
|
|
|
|
|
|
..., |
1319
|
|
|
|
|
|
|
], |
1320
|
|
|
|
|
|
|
reject => [ |
1321
|
|
|
|
|
|
|
$INT, |
1322
|
|
|
|
|
|
|
$NEG_INT, |
1323
|
|
|
|
|
|
|
$NUM, |
1324
|
|
|
|
|
|
|
$NEG_NUM, |
1325
|
|
|
|
|
|
|
..., |
1326
|
|
|
|
|
|
|
$OBJECT, |
1327
|
|
|
|
|
|
|
], |
1328
|
|
|
|
|
|
|
}, |
1329
|
|
|
|
|
|
|
Maybe => {...}, |
1330
|
|
|
|
|
|
|
} |
1331
|
|
|
|
|
|
|
|
1332
|
|
|
|
|
|
|
You need to pass in a glob, an object which overloads globification, and an |
1333
|
|
|
|
|
|
|
object which overloads globification to return an open filehandle. See below |
1334
|
|
|
|
|
|
|
for more details on how to create these things. |
1335
|
|
|
|
|
|
|
|
1336
|
|
|
|
|
|
|
=head2 Variables |
1337
|
|
|
|
|
|
|
|
1338
|
|
|
|
|
|
|
This module also exports many variables containing values which are useful for |
1339
|
|
|
|
|
|
|
testing constraints. Note that references are always empty unless stated |
1340
|
|
|
|
|
|
|
otherwise. You can import these variables individually or import all of them |
1341
|
|
|
|
|
|
|
with the C<:vars> import tag. |
1342
|
|
|
|
|
|
|
|
1343
|
|
|
|
|
|
|
=over 4 |
1344
|
|
|
|
|
|
|
|
1345
|
|
|
|
|
|
|
=item * C<$ZERO> |
1346
|
|
|
|
|
|
|
|
1347
|
|
|
|
|
|
|
=item * C<$ONE> |
1348
|
|
|
|
|
|
|
|
1349
|
|
|
|
|
|
|
=item * C<$INT> |
1350
|
|
|
|
|
|
|
|
1351
|
|
|
|
|
|
|
An arbitrary positive integer. |
1352
|
|
|
|
|
|
|
|
1353
|
|
|
|
|
|
|
=item * C<$NEG_INT> |
1354
|
|
|
|
|
|
|
|
1355
|
|
|
|
|
|
|
An arbitrary negative integer. |
1356
|
|
|
|
|
|
|
|
1357
|
|
|
|
|
|
|
=item * C<$NUM> |
1358
|
|
|
|
|
|
|
|
1359
|
|
|
|
|
|
|
An arbitrary positive non-integer number. |
1360
|
|
|
|
|
|
|
|
1361
|
|
|
|
|
|
|
=item * C<$NEG_NUM> |
1362
|
|
|
|
|
|
|
|
1363
|
|
|
|
|
|
|
An arbitrary negative non-integer number. |
1364
|
|
|
|
|
|
|
|
1365
|
|
|
|
|
|
|
=item * C<$EMPTY_STRING> |
1366
|
|
|
|
|
|
|
|
1367
|
|
|
|
|
|
|
=item * C<$STRING> |
1368
|
|
|
|
|
|
|
|
1369
|
|
|
|
|
|
|
An arbitrary non-empty string. |
1370
|
|
|
|
|
|
|
|
1371
|
|
|
|
|
|
|
=item * C<$NUM_IN_STRING> |
1372
|
|
|
|
|
|
|
|
1373
|
|
|
|
|
|
|
An arbitrary string which contains a number. |
1374
|
|
|
|
|
|
|
|
1375
|
|
|
|
|
|
|
=item * C<$INT_WITH_NL1> |
1376
|
|
|
|
|
|
|
|
1377
|
|
|
|
|
|
|
An string containing an integer followed by a newline. |
1378
|
|
|
|
|
|
|
|
1379
|
|
|
|
|
|
|
=item * C<$INT_WITH_NL2> |
1380
|
|
|
|
|
|
|
|
1381
|
|
|
|
|
|
|
An string containing a newline followed by an integer. |
1382
|
|
|
|
|
|
|
|
1383
|
|
|
|
|
|
|
=item * C<$SCALAR_REF> |
1384
|
|
|
|
|
|
|
|
1385
|
|
|
|
|
|
|
=item * C<$SCALAR_REF_REF> |
1386
|
|
|
|
|
|
|
|
1387
|
|
|
|
|
|
|
A reference containing a reference to a scalar. |
1388
|
|
|
|
|
|
|
|
1389
|
|
|
|
|
|
|
=item * C<$ARRAY_REF> |
1390
|
|
|
|
|
|
|
|
1391
|
|
|
|
|
|
|
=item * C<$HASH_REF> |
1392
|
|
|
|
|
|
|
|
1393
|
|
|
|
|
|
|
=item * C<$CODE_REF> |
1394
|
|
|
|
|
|
|
|
1395
|
|
|
|
|
|
|
=item * C<$GLOB_REF> |
1396
|
|
|
|
|
|
|
|
1397
|
|
|
|
|
|
|
=item * C<$FH> |
1398
|
|
|
|
|
|
|
|
1399
|
|
|
|
|
|
|
An opened filehandle. |
1400
|
|
|
|
|
|
|
|
1401
|
|
|
|
|
|
|
=item * C<$FH_OBJECT> |
1402
|
|
|
|
|
|
|
|
1403
|
|
|
|
|
|
|
An opened L<IO::File> object. |
1404
|
|
|
|
|
|
|
|
1405
|
|
|
|
|
|
|
=item * C<$REGEX> |
1406
|
|
|
|
|
|
|
|
1407
|
|
|
|
|
|
|
A regex created with C<qr//>. |
1408
|
|
|
|
|
|
|
|
1409
|
|
|
|
|
|
|
=item * C<$REGEX_OBJ> |
1410
|
|
|
|
|
|
|
|
1411
|
|
|
|
|
|
|
A regex created with C<qr//> that was then blessed into class. |
1412
|
|
|
|
|
|
|
|
1413
|
|
|
|
|
|
|
=item * C<$FAKE_REGEX> |
1414
|
|
|
|
|
|
|
|
1415
|
|
|
|
|
|
|
A non-regex blessed into the C<Regexp> class which Perl uses internally for |
1416
|
|
|
|
|
|
|
C<qr//> objects. |
1417
|
|
|
|
|
|
|
|
1418
|
|
|
|
|
|
|
=item * C<$OBJECT> |
1419
|
|
|
|
|
|
|
|
1420
|
|
|
|
|
|
|
An arbitrary object. |
1421
|
|
|
|
|
|
|
|
1422
|
|
|
|
|
|
|
=item * C<$UNDEF> |
1423
|
|
|
|
|
|
|
|
1424
|
|
|
|
|
|
|
=item * C<$CLASS_NAME> |
1425
|
|
|
|
|
|
|
|
1426
|
|
|
|
|
|
|
A string containing a loaded package name. |
1427
|
|
|
|
|
|
|
|
1428
|
|
|
|
|
|
|
=item * C<$BOOL_OVERLOAD_TRUE> |
1429
|
|
|
|
|
|
|
|
1430
|
|
|
|
|
|
|
An object which overloads boolification to return true. |
1431
|
|
|
|
|
|
|
|
1432
|
|
|
|
|
|
|
=item * C<$BOOL_OVERLOAD_FALSE> |
1433
|
|
|
|
|
|
|
|
1434
|
|
|
|
|
|
|
An object which overloads boolification to return false. |
1435
|
|
|
|
|
|
|
|
1436
|
|
|
|
|
|
|
=item * C<$STR_OVERLOAD_EMPTY> |
1437
|
|
|
|
|
|
|
|
1438
|
|
|
|
|
|
|
An object which overloads stringification to return an empty string. |
1439
|
|
|
|
|
|
|
|
1440
|
|
|
|
|
|
|
=item * C<$STR_OVERLOAD_FULL> |
1441
|
|
|
|
|
|
|
|
1442
|
|
|
|
|
|
|
An object which overloads stringification to return a non-empty string. |
1443
|
|
|
|
|
|
|
|
1444
|
|
|
|
|
|
|
=item * C<$STR_OVERLOAD_CLASS_NAME> |
1445
|
|
|
|
|
|
|
|
1446
|
|
|
|
|
|
|
An object which overloads stringification to return a loaded package name. |
1447
|
|
|
|
|
|
|
|
1448
|
|
|
|
|
|
|
=item * C<$NUM_OVERLOAD_ZERO> |
1449
|
|
|
|
|
|
|
|
1450
|
|
|
|
|
|
|
=item * C<$NUM_OVERLOAD_ONE> |
1451
|
|
|
|
|
|
|
|
1452
|
|
|
|
|
|
|
=item * C<$NUM_OVERLOAD_NEG> |
1453
|
|
|
|
|
|
|
|
1454
|
|
|
|
|
|
|
=item * C<$NUM_OVERLOAD_DECIMAL> |
1455
|
|
|
|
|
|
|
|
1456
|
|
|
|
|
|
|
=item * C<$NUM_OVERLOAD_NEG_DECIMAL> |
1457
|
|
|
|
|
|
|
|
1458
|
|
|
|
|
|
|
=item * C<$CODE_OVERLOAD> |
1459
|
|
|
|
|
|
|
|
1460
|
|
|
|
|
|
|
=item * C<$SCALAR_OVERLOAD> |
1461
|
|
|
|
|
|
|
|
1462
|
|
|
|
|
|
|
An object which overloads scalar dereferencing to return a non-empty string. |
1463
|
|
|
|
|
|
|
|
1464
|
|
|
|
|
|
|
=item * C<$ARRAY_OVERLOAD> |
1465
|
|
|
|
|
|
|
|
1466
|
|
|
|
|
|
|
An object which overloads array dereferencing to return a non-empty array. |
1467
|
|
|
|
|
|
|
|
1468
|
|
|
|
|
|
|
=item * C<$HASH_OVERLOAD> |
1469
|
|
|
|
|
|
|
|
1470
|
|
|
|
|
|
|
An object which overloads hash dereferencing to return a non-empty hash. |
1471
|
|
|
|
|
|
|
|
1472
|
|
|
|
|
|
|
=back |
1473
|
|
|
|
|
|
|
|
1474
|
|
|
|
|
|
|
=head2 Globs and the _T::GlobOverload package |
1475
|
|
|
|
|
|
|
|
1476
|
|
|
|
|
|
|
To create a glob you can pass around for tests, use this code: |
1477
|
|
|
|
|
|
|
|
1478
|
|
|
|
|
|
|
my $GLOB = do { |
1479
|
|
|
|
|
|
|
no warnings 'once'; |
1480
|
|
|
|
|
|
|
*SOME_GLOB; |
1481
|
|
|
|
|
|
|
}; |
1482
|
|
|
|
|
|
|
|
1483
|
|
|
|
|
|
|
The C<_T::GlobOverload> package is defined when you load C<Test::Specio> so you |
1484
|
|
|
|
|
|
|
can create your own glob overloading objects. Such objects cannot be exported |
1485
|
|
|
|
|
|
|
because the glob they return does not transfer across packages properly. |
1486
|
|
|
|
|
|
|
|
1487
|
|
|
|
|
|
|
You can create such a variable like this: |
1488
|
|
|
|
|
|
|
|
1489
|
|
|
|
|
|
|
local *FOO; |
1490
|
|
|
|
|
|
|
my $GLOB_OVERLOAD = _T::GlobOverload->new( \*FOO ); |
1491
|
|
|
|
|
|
|
|
1492
|
|
|
|
|
|
|
If you want to create a glob overloading object that returns a filehandle, do |
1493
|
|
|
|
|
|
|
this: |
1494
|
|
|
|
|
|
|
|
1495
|
|
|
|
|
|
|
local *BAR; |
1496
|
|
|
|
|
|
|
open BAR, '<', $^X or die "Could not open $^X for the test"; |
1497
|
|
|
|
|
|
|
my $GLOB_OVERLOAD_FH = _T::GlobOverload->new( \*BAR ); |
1498
|
|
|
|
|
|
|
|
1499
|
|
|
|
|
|
|
=head1 SUPPORT |
1500
|
|
|
|
|
|
|
|
1501
|
|
|
|
|
|
|
Bugs may be submitted at L<https://github.com/houseabsolute/Specio/issues>. |
1502
|
|
|
|
|
|
|
|
1503
|
|
|
|
|
|
|
=head1 SOURCE |
1504
|
|
|
|
|
|
|
|
1505
|
|
|
|
|
|
|
The source code repository for Specio can be found at L<https://github.com/houseabsolute/Specio>. |
1506
|
|
|
|
|
|
|
|
1507
|
|
|
|
|
|
|
=head1 AUTHOR |
1508
|
|
|
|
|
|
|
|
1509
|
|
|
|
|
|
|
Dave Rolsky <autarch@urth.org> |
1510
|
|
|
|
|
|
|
|
1511
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
1512
|
|
|
|
|
|
|
|
1513
|
|
|
|
|
|
|
This software is Copyright (c) 2012 - 2022 by Dave Rolsky. |
1514
|
|
|
|
|
|
|
|
1515
|
|
|
|
|
|
|
This is free software, licensed under: |
1516
|
|
|
|
|
|
|
|
1517
|
|
|
|
|
|
|
The Artistic License 2.0 (GPL Compatible) |
1518
|
|
|
|
|
|
|
|
1519
|
|
|
|
|
|
|
The full text of the license can be found in the |
1520
|
|
|
|
|
|
|
F<LICENSE> file included with this distribution. |
1521
|
|
|
|
|
|
|
|
1522
|
|
|
|
|
|
|
=cut |