line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Should; |
2
|
2
|
|
|
2
|
|
187452
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
77
|
|
3
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
53
|
|
4
|
2
|
|
|
2
|
|
57
|
use 5.010001; |
|
2
|
|
|
|
|
9
|
|
|
2
|
|
|
|
|
155
|
|
5
|
|
|
|
|
|
|
our $VERSION = '0.04'; |
6
|
2
|
|
|
2
|
|
2021
|
use Test::Should::Engine; |
|
2
|
|
|
|
|
363122
|
|
|
2
|
|
|
|
|
69
|
|
7
|
2
|
|
|
2
|
|
3422
|
use Data::Dumper (); |
|
2
|
|
|
|
|
25418
|
|
|
2
|
|
|
|
|
62
|
|
8
|
|
|
|
|
|
|
|
9
|
2
|
|
|
2
|
|
2549
|
use parent qw/autobox/; |
|
2
|
|
|
|
|
708
|
|
|
2
|
|
|
|
|
11
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub import { |
12
|
2
|
|
|
2
|
|
19
|
my $class = shift; |
13
|
|
|
|
|
|
|
|
14
|
2
|
|
|
|
|
15
|
$class->SUPER::import( |
15
|
|
|
|
|
|
|
'DEFAULT' => 'Test::Should::Impl::Default', |
16
|
|
|
|
|
|
|
'UNDEF' => 'Test::Should::Impl::Default', |
17
|
|
|
|
|
|
|
'CODE' => 'Test::Should::Impl::Code', |
18
|
|
|
|
|
|
|
); |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
my $ddf = sub { |
22
|
|
|
|
|
|
|
local $Data::Dumper::Terse = 1; |
23
|
|
|
|
|
|
|
local $Data::Dumper::Indent = 0; |
24
|
|
|
|
|
|
|
local $Data::Dumper::MaxDepth = 0; |
25
|
|
|
|
|
|
|
Data::Dumper::Dumper(@_); |
26
|
|
|
|
|
|
|
}; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub _autoload { |
29
|
5
|
|
|
5
|
|
8
|
my $method = shift; |
30
|
5
|
|
|
|
|
20
|
my $test = Test::Should::Engine->run($method, @_); |
31
|
5
|
|
|
|
|
83
|
my $builder = Test::Builder->new(); |
32
|
5
|
100
|
|
|
|
31
|
$builder->ok($test, join('', |
33
|
|
|
|
|
|
|
$ddf->($_[0]), |
34
|
|
|
|
|
|
|
' ', |
35
|
|
|
|
|
|
|
$method, |
36
|
|
|
|
|
|
|
$_[1] ? ' ' . $ddf->($_[1]) : '' |
37
|
|
|
|
|
|
|
)); |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
package # hide from pause |
41
|
|
|
|
|
|
|
Test::Should::Impl::Code; |
42
|
2
|
|
|
2
|
|
23950
|
use parent -norequire, qw/Test::Should::Impl/; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
18
|
|
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub should_change { |
45
|
1
|
|
|
1
|
|
1083
|
my ($modifier, $checker) = @_; |
46
|
1
|
|
|
|
|
3
|
my $first = $checker->(); |
47
|
1
|
|
|
|
|
56
|
$modifier->(); |
48
|
1
|
|
|
|
|
4
|
my $second = $checker->(); |
49
|
|
|
|
|
|
|
|
50
|
1
|
|
|
|
|
6
|
my $builder = Test::Builder->new(); |
51
|
1
|
|
|
|
|
9
|
$builder->isnt_eq($first, $second, 'should_change'); |
52
|
|
|
|
|
|
|
|
53
|
1
|
|
|
|
|
317
|
return Test::Should::Term::ShouldChange->new( |
54
|
|
|
|
|
|
|
first => $first, |
55
|
|
|
|
|
|
|
second => $second, |
56
|
|
|
|
|
|
|
); |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
package # hide from pause |
60
|
|
|
|
|
|
|
Test::Should::Term::ShouldChange; |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
sub new { |
63
|
1
|
|
|
1
|
|
2
|
my $class = shift; |
64
|
1
|
50
|
|
|
|
6
|
my %args = @_==1 ? %{$_[0]} : @_; |
|
0
|
|
|
|
|
0
|
|
65
|
1
|
|
|
|
|
7
|
bless {%args}, $class; |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub by { |
69
|
1
|
|
|
1
|
|
2
|
my ($self, $by) = @_; |
70
|
1
|
|
|
|
|
5
|
my $builder = Test::Builder->new(); |
71
|
1
|
|
|
|
|
13
|
$builder->is_eq($self->{second}, $by, "changed by $by"); |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
package # hide from pause |
75
|
|
|
|
|
|
|
Test::Should::Impl::Default; |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
package # hide from pause |
78
|
|
|
|
|
|
|
UNIVERSAL; |
79
|
|
|
|
|
|
|
|
80
|
0
|
|
|
0
|
|
0
|
sub DESTROY { } |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
our $AUTOLOAD; |
83
|
|
|
|
|
|
|
sub AUTOLOAD { |
84
|
5
|
|
|
5
|
|
3502
|
$AUTOLOAD =~ s/.*:://; |
85
|
5
|
50
|
|
|
|
16
|
if ($AUTOLOAD =~ /^should_/) { |
86
|
5
|
|
|
|
|
17
|
Test::Should::_autoload("$AUTOLOAD", @_); |
87
|
|
|
|
|
|
|
} else { |
88
|
0
|
|
|
|
|
|
Carp::croak("Unknown method: $AUTOLOAD"); |
89
|
|
|
|
|
|
|
} |
90
|
|
|
|
|
|
|
} |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
1; |
93
|
|
|
|
|
|
|
__END__ |