line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test2::V0; |
2
|
155
|
|
|
155
|
|
3355
|
use strict; |
|
155
|
|
|
|
|
356
|
|
|
155
|
|
|
|
|
4406
|
|
3
|
155
|
|
|
155
|
|
785
|
use warnings; |
|
155
|
|
|
|
|
292
|
|
|
155
|
|
|
|
|
3992
|
|
4
|
|
|
|
|
|
|
|
5
|
155
|
|
|
155
|
|
78393
|
use Test2::Util::Importer; |
|
155
|
|
|
|
|
2031
|
|
|
155
|
|
|
|
|
4410
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.000155'; |
8
|
|
|
|
|
|
|
|
9
|
155
|
|
|
155
|
|
1036
|
use Carp qw/croak/; |
|
155
|
|
|
|
|
1954
|
|
|
155
|
|
|
|
|
13383
|
|
10
|
|
|
|
|
|
|
|
11
|
155
|
|
|
155
|
|
77437
|
use Test2::Plugin::SRand(); |
|
155
|
|
|
|
|
566
|
|
|
155
|
|
|
|
|
4218
|
|
12
|
155
|
|
|
155
|
|
71723
|
use Test2::Plugin::UTF8(); |
|
155
|
|
|
|
|
415
|
|
|
155
|
|
|
|
|
3202
|
|
13
|
155
|
|
|
155
|
|
63487
|
use Test2::Tools::Target(); |
|
155
|
|
|
|
|
426
|
|
|
155
|
|
|
|
|
3516
|
|
14
|
|
|
|
|
|
|
|
15
|
155
|
|
|
155
|
|
61159
|
use Test2::Plugin::ExitSummary; |
|
155
|
|
|
|
|
428
|
|
|
155
|
|
|
|
|
1086
|
|
16
|
|
|
|
|
|
|
|
17
|
155
|
|
|
155
|
|
8059
|
use Test2::API qw/intercept context/; |
|
155
|
|
|
|
|
507
|
|
|
155
|
|
|
|
|
7617
|
|
18
|
|
|
|
|
|
|
|
19
|
155
|
|
|
155
|
|
62115
|
use Test2::Tools::Event qw/gen_event/; |
|
155
|
|
|
|
|
423
|
|
|
155
|
|
|
|
|
8836
|
|
20
|
|
|
|
|
|
|
|
21
|
155
|
|
|
155
|
|
62153
|
use Test2::Tools::Defer qw/def do_def/; |
|
155
|
|
|
|
|
447
|
|
|
155
|
|
|
|
|
10262
|
|
22
|
|
|
|
|
|
|
|
23
|
155
|
|
|
|
|
17514
|
use Test2::Tools::Basic qw{ |
24
|
|
|
|
|
|
|
ok pass fail diag note todo skip |
25
|
|
|
|
|
|
|
plan skip_all done_testing bail_out |
26
|
155
|
|
|
155
|
|
65820
|
}; |
|
155
|
|
|
|
|
357
|
|
27
|
|
|
|
|
|
|
|
28
|
155
|
|
|
|
|
39270
|
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
|
155
|
|
|
155
|
|
92698
|
}; |
|
155
|
|
|
|
|
539
|
|
39
|
|
|
|
|
|
|
|
40
|
155
|
|
|
|
|
10951
|
use Test2::Tools::Warnings qw{ |
41
|
|
|
|
|
|
|
warns warning warnings no_warnings |
42
|
155
|
|
|
155
|
|
68344
|
}; |
|
155
|
|
|
|
|
462
|
|
43
|
|
|
|
|
|
|
|
44
|
155
|
|
|
155
|
|
69926
|
use Test2::Tools::ClassicCompare qw/cmp_ok/; |
|
155
|
|
|
|
|
390
|
|
|
155
|
|
|
|
|
12477
|
|
45
|
|
|
|
|
|
|
|
46
|
155
|
|
|
|
|
1334
|
use Test2::Util::Importer 'Test2::Tools::Subtest' => ( |
47
|
|
|
|
|
|
|
subtest_buffered => { -as => 'subtest' }, |
48
|
155
|
|
|
155
|
|
1162
|
); |
|
155
|
|
|
|
|
378
|
|
49
|
|
|
|
|
|
|
|
50
|
155
|
|
|
155
|
|
65014
|
use Test2::Tools::Class qw/can_ok isa_ok DOES_ok/; |
|
155
|
|
|
|
|
403
|
|
|
155
|
|
|
|
|
9640
|
|
51
|
155
|
|
|
155
|
|
62169
|
use Test2::Tools::Encoding qw/set_encoding/; |
|
155
|
|
|
|
|
408
|
|
|
155
|
|
|
|
|
9412
|
|
52
|
155
|
|
|
155
|
|
63110
|
use Test2::Tools::Exports qw/imported_ok not_imported_ok/; |
|
155
|
|
|
|
|
447
|
|
|
155
|
|
|
|
|
9801
|
|
53
|
155
|
|
|
155
|
|
65895
|
use Test2::Tools::Ref qw/ref_ok ref_is ref_is_not/; |
|
155
|
|
|
|
|
393
|
|
|
155
|
|
|
|
|
10008
|
|
54
|
155
|
|
|
155
|
|
69756
|
use Test2::Tools::Mock qw/mock mocked/; |
|
155
|
|
|
|
|
420
|
|
|
155
|
|
|
|
|
10844
|
|
55
|
155
|
|
|
155
|
|
65658
|
use Test2::Tools::Exception qw/try_ok dies lives/; |
|
155
|
|
|
|
|
467
|
|
|
155
|
|
|
|
|
10888
|
|
56
|
155
|
|
|
155
|
|
67583
|
use Test2::Tools::Refcount qw/is_refcount is_oneref refcount/; |
|
155
|
|
|
|
|
398
|
|
|
155
|
|
|
|
|
66425
|
|
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
|
313
|
|
|
313
|
|
5498
|
my $class = shift; |
96
|
|
|
|
|
|
|
|
97
|
313
|
|
|
|
|
878
|
my $caller = caller; |
98
|
313
|
|
|
|
|
649
|
my (@exports, %options); |
99
|
313
|
|
|
|
|
1247
|
while (my $arg = shift @_) { |
100
|
76
|
100
|
50
|
|
|
379
|
push @exports => $arg and next unless substr($arg, 0, 1) eq '-'; |
101
|
66
|
|
|
|
|
343
|
$options{$arg} = shift @_; |
102
|
|
|
|
|
|
|
} |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
# SRand handling |
105
|
313
|
|
|
|
|
711
|
my $srand = delete $options{'-srand'}; |
106
|
|
|
|
|
|
|
|
107
|
313
|
|
|
|
|
650
|
my $no_srand = exists $options{'-no_srand'}; |
108
|
313
|
50
|
|
|
|
830
|
delete $options{'-no_srand'} if $no_srand; |
109
|
|
|
|
|
|
|
|
110
|
313
|
50
|
33
|
|
|
974
|
croak "Cannot combine '-srand' and '-no_srand' options" |
111
|
|
|
|
|
|
|
if $no_srand && defined($srand); |
112
|
|
|
|
|
|
|
|
113
|
313
|
50
|
|
|
|
806
|
if ( !$no_srand ) { |
114
|
313
|
50
|
66
|
|
|
3667
|
Test2::Plugin::SRand->import($srand ? $srand : ()) if defined($srand) || !$SRAND++; |
|
|
100
|
|
|
|
|
|
115
|
|
|
|
|
|
|
} |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
# Pragmas |
118
|
313
|
|
|
|
|
5095
|
my $no_pragmas = delete $options{'-no_pragmas'}; |
119
|
313
|
|
33
|
|
|
1432
|
my $no_strict = delete $options{'-no_strict'} || $no_pragmas; |
120
|
313
|
|
33
|
|
|
1421
|
my $no_warnings = delete $options{'-no_warnings'} || $no_pragmas; |
121
|
313
|
|
33
|
|
|
1847
|
my $no_utf8 = delete $options{'-no_utf8'} || $no_pragmas; |
122
|
|
|
|
|
|
|
|
123
|
313
|
50
|
|
|
|
2467
|
strict->import() unless $no_strict; |
124
|
313
|
50
|
|
|
|
4111
|
'warnings'->import() unless $no_warnings; |
125
|
313
|
50
|
|
|
|
2664
|
Test2::Plugin::UTF8->import() unless $no_utf8; |
126
|
|
|
|
|
|
|
|
127
|
313
|
|
|
|
|
4506
|
my $target = delete $options{'-target'}; |
128
|
313
|
100
|
|
|
|
1456
|
Test2::Tools::Target->import_into($caller, $target) |
129
|
|
|
|
|
|
|
if $target; |
130
|
|
|
|
|
|
|
|
131
|
313
|
50
|
|
|
|
1257
|
croak "Unknown option(s): " . join(', ', sort keys %options) if keys %options; |
132
|
|
|
|
|
|
|
|
133
|
313
|
|
|
|
|
2118
|
Test2::Util::Importer->import_into($class, $caller, @exports); |
134
|
|
|
|
|
|
|
} |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
1; |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
__END__ |