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