/
overload_bool.5.008
73 lines (57 loc) · 2.56 KB
/
overload_bool.5.008
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
Reading database from ...
------------------------------------------ ------ ------ ------ ------ ------
File stmt bran cond sub total
------------------------------------------ ------ ------ ------ ------ ------
tests/overload_bool 60.0 50.0 n/a 25.0 50.0
Total 60.0 50.0 n/a 25.0 50.0
------------------------------------------ ------ ------ ------ ------ ------
Run: ...
Perl version: ...
OS: ...
Start: ...
Finish: ...
tests/overload_bool
line err stmt bran cond sub code
1 #!/usr/bin/perl
2
3 # Copyright 2006-2011, Paul Johnson (pjcj@cpan.org)
4
5 # This software is free. It is licensed under the same terms as Perl itself.
6
7 # The latest version of this software should be available from my homepage:
8 # http://www.pjcj.net
9
10 package Foo;
11 use overload
12 *** 0 0 '""' => sub { shift->render},
13 1 1 bool => sub { die; 1 };
*** 1 0
1
*** 0
*** 0
14
15 sub render {
16 *** 0 0 "foo";
17 }
18
19 1 my $foo = 1;
20 *** 1 50 bless {}, 'Foo' if $foo;
21
22 1 1;
Branches
--------
line err % true false branch
----- --- ------ ------ ------ ------
20 *** 50 1 0 if $foo
Covered Subroutines
-------------------
Subroutine Count Location
---------- ----- ----------------------
BEGIN 1 tests/overload_bool:13
Uncovered Subroutines
---------------------
Subroutine Count Location
---------- ----- ----------------------
__ANON__ 0 tests/overload_bool:12
__ANON__ 0 tests/overload_bool:13
render 0 tests/overload_bool:16