line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test2::V0; |
2
|
155
|
|
|
155
|
|
3593
|
use strict; |
|
155
|
|
|
|
|
358
|
|
|
155
|
|
|
|
|
4796
|
|
3
|
155
|
|
|
155
|
|
756
|
use warnings; |
|
155
|
|
|
|
|
336
|
|
|
155
|
|
|
|
|
4551
|
|
4
|
|
|
|
|
|
|
|
5
|
155
|
|
|
155
|
|
80524
|
use Test2::Util::Importer; |
|
155
|
|
|
|
|
2119
|
|
|
155
|
|
|
|
|
2861
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.000156'; |
8
|
|
|
|
|
|
|
|
9
|
155
|
|
|
155
|
|
1061
|
use Carp qw/croak/; |
|
155
|
|
|
|
|
3991
|
|
|
155
|
|
|
|
|
19353
|
|
10
|
|
|
|
|
|
|
|
11
|
155
|
|
|
155
|
|
80481
|
use Test2::Plugin::SRand(); |
|
155
|
|
|
|
|
552
|
|
|
155
|
|
|
|
|
4202
|
|
12
|
155
|
|
|
155
|
|
71702
|
use Test2::Plugin::UTF8(); |
|
155
|
|
|
|
|
422
|
|
|
155
|
|
|
|
|
3212
|
|
13
|
155
|
|
|
155
|
|
66028
|
use Test2::Tools::Target(); |
|
155
|
|
|
|
|
393
|
|
|
155
|
|
|
|
|
3638
|
|
14
|
|
|
|
|
|
|
|
15
|
155
|
|
|
155
|
|
62751
|
use Test2::Plugin::ExitSummary; |
|
155
|
|
|
|
|
414
|
|
|
155
|
|
|
|
|
1062
|
|
16
|
|
|
|
|
|
|
|
17
|
155
|
|
|
155
|
|
8309
|
use Test2::API qw/intercept context/; |
|
155
|
|
|
|
|
347
|
|
|
155
|
|
|
|
|
7305
|
|
18
|
|
|
|
|
|
|
|
19
|
155
|
|
|
155
|
|
63782
|
use Test2::Tools::Event qw/gen_event/; |
|
155
|
|
|
|
|
418
|
|
|
155
|
|
|
|
|
9149
|
|
20
|
|
|
|
|
|
|
|
21
|
155
|
|
|
155
|
|
63489
|
use Test2::Tools::Defer qw/def do_def/; |
|
155
|
|
|
|
|
432
|
|
|
155
|
|
|
|
|
10456
|
|
22
|
|
|
|
|
|
|
|
23
|
155
|
|
|
|
|
18288
|
use Test2::Tools::Basic qw{ |
24
|
|
|
|
|
|
|
ok pass fail diag note todo skip |
25
|
|
|
|
|
|
|
plan skip_all done_testing bail_out |
26
|
155
|
|
|
155
|
|
69268
|
}; |
|
155
|
|
|
|
|
1390
|
|
27
|
|
|
|
|
|
|
|
28
|
155
|
|
|
|
|
37306
|
use Test2::Tools::Compare qw{ |
29
|
|
|
|
|
|
|
is like isnt unlike |
30
|
|
|
|
|
|
|
match mismatch validator |
31
|
|
|
|
|
|
|
hash array bag object meta meta_check number float rounded within string subset bool check_isa |
32
|
|
|
|
|
|
|
number_lt number_le number_ge number_gt |
33
|
|
|
|
|
|
|
in_set not_in_set check_set |
34
|
|
|
|
|
|
|
item field call call_list call_hash prop check all_items all_keys all_vals all_values |
35
|
|
|
|
|
|
|
etc end filter_items |
36
|
|
|
|
|
|
|
T F D DF E DNE FDNE U L |
37
|
|
|
|
|
|
|
event fail_events |
38
|
|
|
|
|
|
|
exact_ref |
39
|
155
|
|
|
155
|
|
97301
|
}; |
|
155
|
|
|
|
|
557
|
|
40
|
|
|
|
|
|
|
|
41
|
155
|
|
|
|
|
11682
|
use Test2::Tools::Warnings qw{ |
42
|
|
|
|
|
|
|
warns warning warnings no_warnings |
43
|
155
|
|
|
155
|
|
71733
|
}; |
|
155
|
|
|
|
|
390
|
|
44
|
|
|
|
|
|
|
|
45
|
155
|
|
|
155
|
|
71636
|
use Test2::Tools::ClassicCompare qw/cmp_ok/; |
|
155
|
|
|
|
|
417
|
|
|
155
|
|
|
|
|
12383
|
|
46
|
|
|
|
|
|
|
|
47
|
155
|
|
|
|
|
1121
|
use Test2::Util::Importer 'Test2::Tools::Subtest' => ( |
48
|
|
|
|
|
|
|
subtest_buffered => { -as => 'subtest' }, |
49
|
155
|
|
|
155
|
|
1147
|
); |
|
155
|
|
|
|
|
325
|
|
50
|
|
|
|
|
|
|
|
51
|
155
|
|
|
155
|
|
68346
|
use Test2::Tools::Class qw/can_ok isa_ok DOES_ok/; |
|
155
|
|
|
|
|
449
|
|
|
155
|
|
|
|
|
11290
|
|
52
|
155
|
|
|
155
|
|
66201
|
use Test2::Tools::Encoding qw/set_encoding/; |
|
155
|
|
|
|
|
411
|
|
|
155
|
|
|
|
|
9638
|
|
53
|
155
|
|
|
155
|
|
66184
|
use Test2::Tools::Exports qw/imported_ok not_imported_ok/; |
|
155
|
|
|
|
|
464
|
|
|
155
|
|
|
|
|
9679
|
|
54
|
155
|
|
|
155
|
|
66071
|
use Test2::Tools::Ref qw/ref_ok ref_is ref_is_not/; |
|
155
|
|
|
|
|
409
|
|
|
155
|
|
|
|
|
10103
|
|
55
|
155
|
|
|
155
|
|
72658
|
use Test2::Tools::Mock qw/mock mocked/; |
|
155
|
|
|
|
|
449
|
|
|
155
|
|
|
|
|
11225
|
|
56
|
155
|
|
|
155
|
|
68216
|
use Test2::Tools::Exception qw/try_ok dies lives/; |
|
155
|
|
|
|
|
458
|
|
|
155
|
|
|
|
|
10568
|
|
57
|
155
|
|
|
155
|
|
71222
|
use Test2::Tools::Refcount qw/is_refcount is_oneref refcount/; |
|
155
|
|
|
|
|
419
|
|
|
155
|
|
|
|
|
69365
|
|
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
our @EXPORT = qw{ |
60
|
|
|
|
|
|
|
ok pass fail diag note todo skip |
61
|
|
|
|
|
|
|
plan skip_all done_testing bail_out |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
intercept context |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
gen_event |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
def do_def |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
cmp_ok |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
warns warning warnings no_warnings |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
subtest |
74
|
|
|
|
|
|
|
can_ok isa_ok DOES_ok |
75
|
|
|
|
|
|
|
set_encoding |
76
|
|
|
|
|
|
|
imported_ok not_imported_ok |
77
|
|
|
|
|
|
|
ref_ok ref_is ref_is_not |
78
|
|
|
|
|
|
|
mock mocked |
79
|
|
|
|
|
|
|
dies lives try_ok |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
is like isnt unlike |
82
|
|
|
|
|
|
|
match mismatch validator |
83
|
|
|
|
|
|
|
hash array bag object meta meta_check number float rounded within string subset bool check_isa |
84
|
|
|
|
|
|
|
number_lt number_le number_ge number_gt |
85
|
|
|
|
|
|
|
in_set not_in_set check_set |
86
|
|
|
|
|
|
|
item field call call_list call_hash prop check all_items all_keys all_vals all_values |
87
|
|
|
|
|
|
|
etc end filter_items |
88
|
|
|
|
|
|
|
T F D DF E DNE FDNE U L |
89
|
|
|
|
|
|
|
event fail_events |
90
|
|
|
|
|
|
|
exact_ref |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
is_refcount is_oneref refcount |
93
|
|
|
|
|
|
|
}; |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
my $SRAND; |
96
|
|
|
|
|
|
|
sub import { |
97
|
313
|
|
|
313
|
|
5880
|
my $class = shift; |
98
|
|
|
|
|
|
|
|
99
|
313
|
|
|
|
|
746
|
my $caller = caller; |
100
|
313
|
|
|
|
|
648
|
my (@exports, %options); |
101
|
313
|
|
|
|
|
1237
|
while (my $arg = shift @_) { |
102
|
76
|
100
|
50
|
|
|
413
|
push @exports => $arg and next unless substr($arg, 0, 1) eq '-'; |
103
|
66
|
|
|
|
|
282
|
$options{$arg} = shift @_; |
104
|
|
|
|
|
|
|
} |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
# SRand handling |
107
|
313
|
|
|
|
|
742
|
my $srand = delete $options{'-srand'}; |
108
|
|
|
|
|
|
|
|
109
|
313
|
|
|
|
|
596
|
my $no_srand = exists $options{'-no_srand'}; |
110
|
313
|
50
|
|
|
|
903
|
delete $options{'-no_srand'} if $no_srand; |
111
|
|
|
|
|
|
|
|
112
|
313
|
50
|
33
|
|
|
942
|
croak "Cannot combine '-srand' and '-no_srand' options" |
113
|
|
|
|
|
|
|
if $no_srand && defined($srand); |
114
|
|
|
|
|
|
|
|
115
|
313
|
50
|
|
|
|
826
|
if ( !$no_srand ) { |
116
|
313
|
50
|
66
|
|
|
3287
|
Test2::Plugin::SRand->import($srand ? $srand : ()) if defined($srand) || !$SRAND++; |
|
|
100
|
|
|
|
|
|
117
|
|
|
|
|
|
|
} |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
# Pragmas |
120
|
313
|
|
|
|
|
4771
|
my $no_pragmas = delete $options{'-no_pragmas'}; |
121
|
313
|
|
33
|
|
|
1409
|
my $no_strict = delete $options{'-no_strict'} || $no_pragmas; |
122
|
313
|
|
33
|
|
|
1347
|
my $no_warnings = delete $options{'-no_warnings'} || $no_pragmas; |
123
|
313
|
|
33
|
|
|
1802
|
my $no_utf8 = delete $options{'-no_utf8'} || $no_pragmas; |
124
|
|
|
|
|
|
|
|
125
|
313
|
50
|
|
|
|
2266
|
strict->import() unless $no_strict; |
126
|
313
|
50
|
|
|
|
3860
|
'warnings'->import() unless $no_warnings; |
127
|
313
|
50
|
|
|
|
2673
|
Test2::Plugin::UTF8->import() unless $no_utf8; |
128
|
|
|
|
|
|
|
|
129
|
313
|
|
|
|
|
4563
|
my $target = delete $options{'-target'}; |
130
|
313
|
100
|
|
|
|
1553
|
Test2::Tools::Target->import_into($caller, $target) |
131
|
|
|
|
|
|
|
if $target; |
132
|
|
|
|
|
|
|
|
133
|
313
|
50
|
|
|
|
1375
|
croak "Unknown option(s): " . join(', ', sort keys %options) if keys %options; |
134
|
|
|
|
|
|
|
|
135
|
313
|
|
|
|
|
2235
|
Test2::Util::Importer->import_into($class, $caller, @exports); |
136
|
|
|
|
|
|
|
} |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
1; |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
__END__ |