line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
29
|
|
2
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
35
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package Test::Deep::Number 1.204; |
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
399
|
use Test::Deep::Cmp; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
4
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
6
|
use Scalar::Util; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
98
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub init |
11
|
|
|
|
|
|
|
{ |
12
|
8
|
|
|
8
|
0
|
15
|
my $self = shift; |
13
|
|
|
|
|
|
|
|
14
|
8
|
|
|
|
|
47
|
$self->{val} = shift(@_) + 0; |
15
|
8
|
|
|
|
|
17
|
$self->{tolerance} = shift; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub descend |
19
|
|
|
|
|
|
|
{ |
20
|
8
|
|
|
8
|
0
|
10
|
my $self = shift; |
21
|
8
|
|
|
|
|
14
|
my $got = shift; |
22
|
8
|
|
|
|
|
18
|
$self->data->{got_string} = $got; |
23
|
|
|
|
|
|
|
{ |
24
|
1
|
|
|
1
|
|
5
|
no warnings 'numeric'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
308
|
|
|
8
|
|
|
|
|
12
|
|
25
|
8
|
|
|
|
|
47
|
$got += 0; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
8
|
|
|
|
|
26
|
$self->data->{got} = $got; |
29
|
8
|
100
|
|
|
|
31
|
if (defined(my $tolerance = $self->{tolerance})) |
30
|
|
|
|
|
|
|
{ |
31
|
2
|
|
|
|
|
10
|
return abs($got - $self->{val}) <= $tolerance; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
else |
34
|
|
|
|
|
|
|
{ |
35
|
6
|
|
|
|
|
24
|
return $got == $self->{val}; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub diag_message |
40
|
|
|
|
|
|
|
{ |
41
|
4
|
|
|
4
|
0
|
7
|
my $self = shift; |
42
|
|
|
|
|
|
|
|
43
|
4
|
|
|
|
|
6
|
my $where = shift; |
44
|
|
|
|
|
|
|
|
45
|
4
|
|
|
|
|
12
|
return "Comparing $where as a number"; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub renderGot |
49
|
|
|
|
|
|
|
{ |
50
|
4
|
|
|
4
|
0
|
5
|
my $self = shift; |
51
|
4
|
|
|
|
|
7
|
my $val = shift; |
52
|
|
|
|
|
|
|
|
53
|
4
|
|
|
|
|
9
|
my $got_string = $self->data->{got_string}; |
54
|
4
|
100
|
|
|
|
25
|
if ("$val" ne "$got_string") |
55
|
|
|
|
|
|
|
{ |
56
|
1
|
|
|
|
|
6
|
$got_string = $self->SUPER::renderGot($got_string); |
57
|
1
|
|
|
|
|
7
|
return "$val ($got_string)" |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
else |
60
|
|
|
|
|
|
|
{ |
61
|
3
|
|
|
|
|
18
|
return $val; |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
sub renderExp |
65
|
|
|
|
|
|
|
{ |
66
|
4
|
|
|
4
|
0
|
7
|
my $self = shift; |
67
|
|
|
|
|
|
|
|
68
|
4
|
|
|
|
|
7
|
my $exp = $self->{val}; |
69
|
|
|
|
|
|
|
|
70
|
4
|
100
|
|
|
|
8
|
if (defined(my $tolerance = $self->{tolerance})) |
71
|
|
|
|
|
|
|
{ |
72
|
1
|
|
|
|
|
9
|
return "$exp +/- $tolerance"; |
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
else |
75
|
|
|
|
|
|
|
{ |
76
|
3
|
|
|
|
|
10
|
return $exp; |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
1; |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
__END__ |