File Coverage

blib/lib/Text/WordDiff/ANSIColor.pm
Criterion Covered Total %
statement 18 18 100.0
branch n/a
condition n/a
subroutine 7 7 100.0
pod 0 3 0.0
total 25 28 89.2


line stmt bran cond sub pod time code
1             package Text::WordDiff::ANSIColor;
2              
3 1     1   901 use strict;
  1         1  
  1         96  
4 1     1   7 use Term::ANSIColor qw(:constants);
  1         2  
  1         253  
5 1     1   6 use vars qw($VERSION @ISA);
  1         1  
  1         59  
6              
7             # Term::ANSIColor doesn't support STRIKETHROUGH, so we'll do it ourselves.
8 1     1   17 use constant STRIKETHROUGH => "\e[9m";
  1         2  
  1         160  
9              
10             $VERSION = '0.09';
11             @ISA = qw(Text::WordDiff::Base);
12              
13             sub same_items {
14 29     29 0 35 shift;
15 29         67 return join '', @_;
16             }
17              
18             sub delete_items {
19 26     26 0 28 shift;
20 26         424 return join '', BOLD, RED, STRIKETHROUGH, @_, RESET;
21             }
22              
23             sub insert_items {
24 26     26 0 28 shift;
25 26         313 return join '', BOLD, GREEN, UNDERLINE, @_, RESET;
26             }
27              
28             1;
29             __END__