line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test2::V0; |
2
|
154
|
|
|
154
|
|
2904
|
use strict; |
|
154
|
|
|
|
|
361
|
|
|
154
|
|
|
|
|
4266
|
|
3
|
154
|
|
|
154
|
|
699
|
use warnings; |
|
154
|
|
|
|
|
322
|
|
|
154
|
|
|
|
|
3772
|
|
4
|
|
|
|
|
|
|
|
5
|
154
|
|
|
154
|
|
69840
|
use Test2::Util::Importer; |
|
154
|
|
|
|
|
1876
|
|
|
154
|
|
|
|
|
2738
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.000153'; |
8
|
|
|
|
|
|
|
|
9
|
154
|
|
|
154
|
|
964
|
use Carp qw/croak/; |
|
154
|
|
|
|
|
285
|
|
|
154
|
|
|
|
|
13528
|
|
10
|
|
|
|
|
|
|
|
11
|
154
|
|
|
154
|
|
67435
|
use Test2::Plugin::SRand(); |
|
154
|
|
|
|
|
536
|
|
|
154
|
|
|
|
|
3961
|
|
12
|
154
|
|
|
154
|
|
64075
|
use Test2::Plugin::UTF8(); |
|
154
|
|
|
|
|
392
|
|
|
154
|
|
|
|
|
3055
|
|
13
|
154
|
|
|
154
|
|
57491
|
use Test2::Tools::Target(); |
|
154
|
|
|
|
|
432
|
|
|
154
|
|
|
|
|
3239
|
|
14
|
|
|
|
|
|
|
|
15
|
154
|
|
|
154
|
|
56086
|
use Test2::Plugin::ExitSummary; |
|
154
|
|
|
|
|
407
|
|
|
154
|
|
|
|
|
1009
|
|
16
|
|
|
|
|
|
|
|
17
|
154
|
|
|
154
|
|
7767
|
use Test2::API qw/intercept context/; |
|
154
|
|
|
|
|
311
|
|
|
154
|
|
|
|
|
6814
|
|
18
|
|
|
|
|
|
|
|
19
|
154
|
|
|
154
|
|
56654
|
use Test2::Tools::Event qw/gen_event/; |
|
154
|
|
|
|
|
393
|
|
|
154
|
|
|
|
|
8472
|
|
20
|
|
|
|
|
|
|
|
21
|
154
|
|
|
154
|
|
56566
|
use Test2::Tools::Defer qw/def do_def/; |
|
154
|
|
|
|
|
372
|
|
|
154
|
|
|
|
|
9618
|
|
22
|
|
|
|
|
|
|
|
23
|
154
|
|
|
|
|
16607
|
use Test2::Tools::Basic qw{ |
24
|
|
|
|
|
|
|
ok pass fail diag note todo skip |
25
|
|
|
|
|
|
|
plan skip_all done_testing bail_out |
26
|
154
|
|
|
154
|
|
61030
|
}; |
|
154
|
|
|
|
|
386
|
|
27
|
|
|
|
|
|
|
|
28
|
154
|
|
|
|
|
35266
|
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
|
|
|
|
|
|
|
in_set not_in_set check_set |
33
|
|
|
|
|
|
|
item field call call_list call_hash prop check all_items all_keys all_vals all_values |
34
|
|
|
|
|
|
|
etc end filter_items |
35
|
|
|
|
|
|
|
T F D DF E DNE FDNE U L |
36
|
|
|
|
|
|
|
event fail_events |
37
|
|
|
|
|
|
|
exact_ref |
38
|
154
|
|
|
154
|
|
84281
|
}; |
|
154
|
|
|
|
|
509
|
|
39
|
|
|
|
|
|
|
|
40
|
154
|
|
|
|
|
10228
|
use Test2::Tools::Warnings qw{ |
41
|
|
|
|
|
|
|
warns warning warnings no_warnings |
42
|
154
|
|
|
154
|
|
63346
|
}; |
|
154
|
|
|
|
|
409
|
|
43
|
|
|
|
|
|
|
|
44
|
154
|
|
|
154
|
|
62786
|
use Test2::Tools::ClassicCompare qw/cmp_ok/; |
|
154
|
|
|
|
|
386
|
|
|
154
|
|
|
|
|
12156
|
|
45
|
|
|
|
|
|
|
|
46
|
154
|
|
|
|
|
1141
|
use Test2::Util::Importer 'Test2::Tools::Subtest' => ( |
47
|
|
|
|
|
|
|
subtest_buffered => { -as => 'subtest' }, |
48
|
154
|
|
|
154
|
|
1096
|
); |
|
154
|
|
|
|
|
395
|
|
49
|
|
|
|
|
|
|
|
50
|
154
|
|
|
154
|
|
59163
|
use Test2::Tools::Class qw/can_ok isa_ok DOES_ok/; |
|
154
|
|
|
|
|
398
|
|
|
154
|
|
|
|
|
9162
|
|
51
|
154
|
|
|
154
|
|
56621
|
use Test2::Tools::Encoding qw/set_encoding/; |
|
154
|
|
|
|
|
407
|
|
|
154
|
|
|
|
|
8085
|
|
52
|
154
|
|
|
154
|
|
57518
|
use Test2::Tools::Exports qw/imported_ok not_imported_ok/; |
|
154
|
|
|
|
|
413
|
|
|
154
|
|
|
|
|
9210
|
|
53
|
154
|
|
|
154
|
|
60238
|
use Test2::Tools::Ref qw/ref_ok ref_is ref_is_not/; |
|
154
|
|
|
|
|
389
|
|
|
154
|
|
|
|
|
9396
|
|
54
|
154
|
|
|
154
|
|
62731
|
use Test2::Tools::Mock qw/mock mocked/; |
|
154
|
|
|
|
|
415
|
|
|
154
|
|
|
|
|
10235
|
|
55
|
154
|
|
|
154
|
|
59681
|
use Test2::Tools::Exception qw/try_ok dies lives/; |
|
154
|
|
|
|
|
404
|
|
|
154
|
|
|
|
|
9681
|
|
56
|
154
|
|
|
154
|
|
63663
|
use Test2::Tools::Refcount qw/is_refcount is_oneref refcount/; |
|
154
|
|
|
|
|
406
|
|
|
154
|
|
|
|
|
62800
|
|
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
our @EXPORT = qw{ |
59
|
|
|
|
|
|
|
ok pass fail diag note todo skip |
60
|
|
|
|
|
|
|
plan skip_all done_testing bail_out |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
intercept context |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
gen_event |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
def do_def |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
cmp_ok |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
warns warning warnings no_warnings |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
subtest |
73
|
|
|
|
|
|
|
can_ok isa_ok DOES_ok |
74
|
|
|
|
|
|
|
set_encoding |
75
|
|
|
|
|
|
|
imported_ok not_imported_ok |
76
|
|
|
|
|
|
|
ref_ok ref_is ref_is_not |
77
|
|
|
|
|
|
|
mock mocked |
78
|
|
|
|
|
|
|
dies lives try_ok |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
is like isnt unlike |
81
|
|
|
|
|
|
|
match mismatch validator |
82
|
|
|
|
|
|
|
hash array bag object meta meta_check number float rounded within string subset bool check_isa |
83
|
|
|
|
|
|
|
in_set not_in_set check_set |
84
|
|
|
|
|
|
|
item field call call_list call_hash prop check all_items all_keys all_vals all_values |
85
|
|
|
|
|
|
|
etc end filter_items |
86
|
|
|
|
|
|
|
T F D DF E DNE FDNE U L |
87
|
|
|
|
|
|
|
event fail_events |
88
|
|
|
|
|
|
|
exact_ref |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
is_refcount is_oneref refcount |
91
|
|
|
|
|
|
|
}; |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
my $SRAND; |
94
|
|
|
|
|
|
|
sub import { |
95
|
312
|
|
|
312
|
|
5642
|
my $class = shift; |
96
|
|
|
|
|
|
|
|
97
|
312
|
|
|
|
|
738
|
my $caller = caller; |
98
|
312
|
|
|
|
|
634
|
my (@exports, %options); |
99
|
312
|
|
|
|
|
1154
|
while (my $arg = shift @_) { |
100
|
76
|
100
|
50
|
|
|
373
|
push @exports => $arg and next unless substr($arg, 0, 1) eq '-'; |
101
|
66
|
|
|
|
|
275
|
$options{$arg} = shift @_; |
102
|
|
|
|
|
|
|
} |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
# SRand handling |
105
|
312
|
|
|
|
|
685
|
my $srand = delete $options{'-srand'}; |
106
|
|
|
|
|
|
|
|
107
|
312
|
|
|
|
|
595
|
my $no_srand = exists $options{'-no_srand'}; |
108
|
312
|
50
|
|
|
|
786
|
delete $options{'-no_srand'} if $no_srand; |
109
|
|
|
|
|
|
|
|
110
|
312
|
50
|
33
|
|
|
941
|
croak "Cannot combine '-srand' and '-no_srand' options" |
111
|
|
|
|
|
|
|
if $no_srand && defined($srand); |
112
|
|
|
|
|
|
|
|
113
|
312
|
50
|
|
|
|
725
|
if ( !$no_srand ) { |
114
|
312
|
50
|
66
|
|
|
3579
|
Test2::Plugin::SRand->import($srand ? $srand : ()) if defined($srand) || !$SRAND++; |
|
|
100
|
|
|
|
|
|
115
|
|
|
|
|
|
|
} |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
# Pragmas |
118
|
312
|
|
|
|
|
4589
|
my $no_pragmas = delete $options{'-no_pragmas'}; |
119
|
312
|
|
33
|
|
|
1426
|
my $no_strict = delete $options{'-no_strict'} || $no_pragmas; |
120
|
312
|
|
33
|
|
|
1375
|
my $no_warnings = delete $options{'-no_warnings'} || $no_pragmas; |
121
|
312
|
|
33
|
|
|
1762
|
my $no_utf8 = delete $options{'-no_utf8'} || $no_pragmas; |
122
|
|
|
|
|
|
|
|
123
|
312
|
50
|
|
|
|
2181
|
strict->import() unless $no_strict; |
124
|
312
|
50
|
|
|
|
3980
|
'warnings'->import() unless $no_warnings; |
125
|
312
|
50
|
|
|
|
2453
|
Test2::Plugin::UTF8->import() unless $no_utf8; |
126
|
|
|
|
|
|
|
|
127
|
312
|
|
|
|
|
4182
|
my $target = delete $options{'-target'}; |
128
|
312
|
100
|
|
|
|
1463
|
Test2::Tools::Target->import_into($caller, $target) |
129
|
|
|
|
|
|
|
if $target; |
130
|
|
|
|
|
|
|
|
131
|
312
|
50
|
|
|
|
1277
|
croak "Unknown option(s): " . join(', ', sort keys %options) if keys %options; |
132
|
|
|
|
|
|
|
|
133
|
312
|
|
|
|
|
2132
|
Test2::Util::Importer->import_into($class, $caller, @exports); |
134
|
|
|
|
|
|
|
} |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
1; |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
__END__ |