Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

file 62 lines (50 sloc) 2.58 kb
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
Reading database from ...


------------------------------------------ ------ ------ ------ ------ ------
File stmt bran cond sub total
------------------------------------------ ------ ------ ------ ------ ------
tests/overloaded 100.0 50.0 n/a 100.0 91.7
Total 100.0 50.0 n/a 100.0 91.7
------------------------------------------ ------ ------ ------ ------ ------


Run: ...
Perl version: ...
OS: ...
Start: ...
Finish: ...

tests/overloaded

line err stmt bran cond sub code
1 #!/usr/bin/perl
2
3 # Copyright 2003-2012, Paul Johnson (paul@pjcj.net)
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 # Example stolen from overload documentation
11
12 package two_face;
13
14 1 1 sub new { my $p = shift; bless [@_], $p }
               1
15 use overload '""' => \&str, '0+' => \&num, fallback => 1;
16 2 2 sub num {shift->[1]}
17 2 2 sub str {shift->[0]}
18
19 package main;
20
21 1 my $seven = new two_face ("vii", 7);
22 1 printf "seven=$seven, seven=%d, eight=%d\n", $seven, $seven+1;
23 *** 1 50 print "seven contains `i'\n" if $seven =~ /i/;


Branches
--------

line err % true false branch
----- --- ------ ------ ------ ------
23 *** 50 1 0 if $seven =~ /i/


Covered Subroutines
-------------------

Subroutine Count Location
---------- ----- -------------------
new 1 tests/overloaded:14
num 2 tests/overloaded:16
str 2 tests/overloaded:17
Something went wrong with that request. Please try again.