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   3799 use strict;
  1         2  
  1         41  
4 1     1   15 use Term::ANSIColor qw(:constants);
  1         2  
  1         467  
5 1     1   8 use vars qw($VERSION @ISA);
  1         2  
  1         70  
6              
7             # Term::ANSIColor doesn't support STRIKETHROUGH, so we'll do it ourselves.
8 1     1   7 use constant STRIKETHROUGH => "\e[9m";
  1         2  
  1         237  
9              
10             $VERSION = '0.08';
11             @ISA = qw(Text::WordDiff::Base);
12              
13             sub same_items {
14 29     29 0 39 shift;
15 29         107 return join '', @_;
16             }
17              
18             sub delete_items {
19 26     26 0 29 shift;
20 26         698 return join '', BOLD, RED, STRIKETHROUGH, @_, RESET;
21             }
22              
23             sub insert_items {
24 26     26 0 28 shift;
25 26         665 return join '', BOLD, GREEN, UNDERLINE, @_, RESET;
26             }
27              
28             1;
29             __END__