line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
8
|
|
|
8
|
|
1050740
|
use 5.006; # our |
|
8
|
|
|
|
|
33
|
|
2
|
8
|
|
|
8
|
|
46
|
use strict; |
|
8
|
|
|
|
|
14
|
|
|
8
|
|
|
|
|
179
|
|
3
|
8
|
|
|
8
|
|
51
|
use warnings; |
|
8
|
|
|
|
|
16
|
|
|
8
|
|
|
|
|
633
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Test::Stream::Plugin::Explain::Terse; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.001001'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# ABSTRACT: Dump anything in a single line in 80 characters or fewer |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY |
12
|
|
|
|
|
|
|
|
13
|
8
|
|
|
8
|
|
810
|
use Test::Stream::Exporter qw/ default_exports import /; |
|
8
|
|
|
|
|
3018
|
|
|
8
|
|
|
|
|
58
|
|
14
|
8
|
|
|
8
|
|
7479
|
use Data::Dump qw( pp ); |
|
8
|
|
|
|
|
63421
|
|
|
8
|
|
|
|
|
664
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
default_exports qw/ explain_terse /; |
17
|
|
|
|
|
|
|
|
18
|
8
|
|
|
8
|
|
56
|
no Test::Stream::Exporter; |
|
8
|
|
|
|
|
15
|
|
|
8
|
|
|
|
|
62
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
|
29
|
8
|
|
|
8
|
|
847
|
use constant MAX_LENGTH => 80; |
|
8
|
|
|
|
|
13
|
|
|
8
|
|
|
|
|
595
|
|
30
|
8
|
|
|
8
|
|
42
|
use constant RIGHT_CHARS => 1; |
|
8
|
|
|
|
|
13
|
|
|
8
|
|
|
|
|
377
|
|
31
|
8
|
|
|
8
|
|
40
|
use constant ELIDED => q[...]; |
|
8
|
|
|
|
|
14
|
|
|
8
|
|
|
|
|
1320
|
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub explain_terse { |
34
|
6
|
|
|
6
|
|
4719
|
my $content = pp( $_[0] ); # note: using this for now because of list compression |
35
|
6
|
|
|
|
|
770
|
$content =~ s/\s*\n\s*/ /sxg; # nuke literal newlines and swallow excess space. |
36
|
6
|
100
|
|
|
|
41
|
return $content if length $content <= MAX_LENGTH; |
37
|
|
|
|
|
|
|
|
38
|
2
|
|
|
|
|
11
|
return ( substr $content, 0, MAX_LENGTH - ( length ELIDED ) - RIGHT_CHARS ) . ELIDED |
39
|
|
|
|
|
|
|
. ( substr $content, ( length $content ) - RIGHT_CHARS ); |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
1; |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
__END__ |