line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Stream::Plugin::Classic; |
2
|
2
|
|
|
2
|
|
553
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
46
|
|
3
|
2
|
|
|
2
|
|
9
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
47
|
|
4
|
|
|
|
|
|
|
|
5
|
2
|
|
|
2
|
|
10
|
use Test::Stream::Exporter; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
13
|
|
6
|
|
|
|
|
|
|
default_exports qw/is is_deeply isnt like unlike/; |
7
|
2
|
|
|
2
|
|
10
|
no Test::Stream::Exporter; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
8
|
|
8
|
|
|
|
|
|
|
|
9
|
2
|
|
|
2
|
|
11
|
use Scalar::Util qw/blessed/; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
97
|
|
10
|
|
|
|
|
|
|
|
11
|
2
|
|
|
2
|
|
1061
|
use Test::Stream::Compare qw/-all/; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
34
|
|
12
|
2
|
|
|
2
|
|
14
|
use Test::Stream::Context qw/context/; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
14
|
|
13
|
2
|
|
|
2
|
|
13
|
use Test::Stream::Util qw/rtype/; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
8
|
|
14
|
|
|
|
|
|
|
|
15
|
2
|
|
|
2
|
|
1320
|
use Test::Stream::Compare::String; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
15
|
|
16
|
2
|
|
|
2
|
|
1270
|
use Test::Stream::Compare::Pattern; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
15
|
|
17
|
|
|
|
|
|
|
|
18
|
2
|
|
|
2
|
|
1436
|
use Test::Stream::Plugin::Compare(); |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
1496
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub is($$;$@) { |
21
|
7
|
|
|
7
|
1
|
41
|
my ($got, $exp, $name, @diag) = @_; |
22
|
7
|
|
|
|
|
25
|
my $ctx = context(); |
23
|
|
|
|
|
|
|
|
24
|
7
|
|
|
|
|
23
|
my @caller = caller; |
25
|
|
|
|
|
|
|
|
26
|
7
|
|
|
|
|
34
|
my $delta = compare($got, $exp, \&is_convert); |
27
|
|
|
|
|
|
|
|
28
|
7
|
100
|
|
|
|
21
|
if ($delta) { |
29
|
3
|
|
|
|
|
12
|
$ctx->ok(0, $name, [$delta->table, @diag]); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
else { |
32
|
4
|
|
|
|
|
13
|
$ctx->ok(1, $name); |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
7
|
|
|
|
|
27
|
$ctx->release; |
36
|
7
|
|
|
|
|
45
|
return !$delta; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub isnt($$;$@) { |
40
|
4
|
|
|
4
|
1
|
23
|
my ($got, $exp, $name, @diag) = @_; |
41
|
4
|
|
|
|
|
13
|
my $ctx = context(); |
42
|
|
|
|
|
|
|
|
43
|
4
|
|
|
|
|
16
|
my @caller = caller; |
44
|
|
|
|
|
|
|
|
45
|
4
|
|
|
|
|
17
|
my $delta = compare($got, $exp, \&isnt_convert); |
46
|
|
|
|
|
|
|
|
47
|
4
|
100
|
|
|
|
13
|
if ($delta) { |
48
|
1
|
|
|
|
|
4
|
$ctx->ok(0, $name, [$delta->table, @diag]); |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
else { |
51
|
3
|
|
|
|
|
11
|
$ctx->ok(1, $name); |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
4
|
|
|
|
|
21
|
$ctx->release; |
55
|
4
|
|
|
|
|
16
|
return !$delta; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub is_convert { |
59
|
7
|
|
|
7
|
0
|
9
|
my ($thing) = @_; |
60
|
7
|
100
|
|
|
|
42
|
return Test::Stream::Compare::Undef->new() |
61
|
|
|
|
|
|
|
unless defined $thing; |
62
|
5
|
|
|
|
|
29
|
return Test::Stream::Compare::String->new(input => $thing); |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
sub isnt_convert { |
66
|
4
|
|
|
4
|
0
|
8
|
my ($thing) = @_; |
67
|
4
|
50
|
|
|
|
11
|
return Test::Stream::Compare::Undef->new() |
68
|
|
|
|
|
|
|
unless defined $thing; |
69
|
4
|
|
|
|
|
15
|
my $str = Test::Stream::Compare::String->new(input => $thing, negate => 1); |
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
sub like($$;$@) { |
73
|
3
|
|
|
3
|
1
|
21
|
my ($got, $exp, $name, @diag) = @_; |
74
|
3
|
|
|
|
|
31
|
my $ctx = context(); |
75
|
|
|
|
|
|
|
|
76
|
3
|
|
|
|
|
13
|
my $delta = compare($got, $exp, \&like_convert); |
77
|
|
|
|
|
|
|
|
78
|
3
|
100
|
|
|
|
10
|
if ($delta) { |
79
|
1
|
|
|
|
|
5
|
$ctx->ok(0, $name, [$delta->table, @diag]); |
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
else { |
82
|
2
|
|
|
|
|
7
|
$ctx->ok(1, $name); |
83
|
|
|
|
|
|
|
} |
84
|
|
|
|
|
|
|
|
85
|
3
|
|
|
|
|
9
|
$ctx->release; |
86
|
3
|
|
|
|
|
17
|
return !$delta; |
87
|
|
|
|
|
|
|
} |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
sub unlike($$;$@) { |
90
|
3
|
|
|
3
|
1
|
17
|
my ($got, $exp, $name, @diag) = @_; |
91
|
3
|
|
|
|
|
12
|
my $ctx = context(); |
92
|
|
|
|
|
|
|
|
93
|
3
|
|
|
|
|
13
|
my $delta = compare($got, $exp, \&unlike_convert); |
94
|
|
|
|
|
|
|
|
95
|
3
|
100
|
|
|
|
9
|
if ($delta) { |
96
|
1
|
|
|
|
|
6
|
$ctx->ok(0, $name, [$delta->table, @diag]); |
97
|
|
|
|
|
|
|
} |
98
|
|
|
|
|
|
|
else { |
99
|
2
|
|
|
|
|
7
|
$ctx->ok(1, $name); |
100
|
|
|
|
|
|
|
} |
101
|
|
|
|
|
|
|
|
102
|
3
|
|
|
|
|
13
|
$ctx->release; |
103
|
3
|
|
|
|
|
12
|
return !$delta; |
104
|
|
|
|
|
|
|
} |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
sub like_convert { |
107
|
3
|
|
|
3
|
0
|
5
|
my ($thing) = @_; |
108
|
3
|
|
|
|
|
21
|
return Test::Stream::Compare::Pattern->new( |
109
|
|
|
|
|
|
|
pattern => $thing, |
110
|
|
|
|
|
|
|
); |
111
|
|
|
|
|
|
|
} |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
sub unlike_convert { |
114
|
3
|
|
|
3
|
0
|
6
|
my ($thing) = @_; |
115
|
3
|
|
|
|
|
13
|
return Test::Stream::Compare::Pattern->new( |
116
|
|
|
|
|
|
|
negate => 1, |
117
|
|
|
|
|
|
|
pattern => $thing, |
118
|
|
|
|
|
|
|
); |
119
|
|
|
|
|
|
|
} |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
sub is_deeply($$;$@) { |
122
|
2
|
|
|
2
|
1
|
6
|
my ($got, $exp, $name, @diag) = @_; |
123
|
2
|
|
|
|
|
8
|
my $ctx = context(); |
124
|
|
|
|
|
|
|
|
125
|
2
|
|
|
|
|
8
|
my @caller = caller; |
126
|
|
|
|
|
|
|
|
127
|
2
|
|
|
|
|
8
|
my $delta = compare($got, $exp, \&Test::Stream::Plugin::Compare::strict_convert); |
128
|
|
|
|
|
|
|
|
129
|
2
|
50
|
|
|
|
8
|
if ($delta) { |
130
|
0
|
|
|
|
|
0
|
$ctx->ok(0, $name, [$delta->table, @diag]); |
131
|
|
|
|
|
|
|
} |
132
|
|
|
|
|
|
|
else { |
133
|
2
|
|
|
|
|
18
|
$ctx->ok(1, $name); |
134
|
|
|
|
|
|
|
} |
135
|
|
|
|
|
|
|
|
136
|
2
|
|
|
|
|
9
|
$ctx->release; |
137
|
2
|
|
|
|
|
9
|
return !$delta; |
138
|
|
|
|
|
|
|
} |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
1; |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
__END__ |