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