File Coverage

blib/lib/Tree/Range/conflict.pm
Criterion Covered Total %
statement 9 9 100.0
branch 2 2 100.0
condition n/a
subroutine 3 3 100.0
pod 0 1 0.0
total 14 15 93.3


line stmt bran cond sub pod time code
1             ### conflict.pm --- Protect ranges from being written over -*- Perl -*-
2              
3             ### Ivan Shmakov, 2013
4              
5             ## To the extent possible under law, the author(s) have dedicated all
6             ## copyright and related and neighboring rights to this software to the
7             ## public domain worldwide. This software is distributed without any
8             ## warranty.
9              
10             ## You should have received a copy of the CC0 Public Domain Dedication
11             ## along with this software. If not, see
12             ## .
13              
14             ### Code:
15              
16             package Tree::Range::conflict;
17              
18 3     3   4319 use mro;
  3         3614  
  3         18  
19 3     3   134 use strict;
  3         7  
  3         621  
20              
21             our $VERSION = 0.22;
22              
23             require Carp;
24              
25             sub range_set {
26 3     3 0 174 my ($self, $lower, $upper, $value) = @_;
27 3 100       9 Carp::croak ("Range (", $lower, " to ", $upper,
28             ") is already associated with a value")
29             unless ($self->range_free_p ($lower, $upper));
30             ## .
31 2         11 $self->next::method ($lower, $upper, $value);
32             }
33              
34             1;
35              
36             ### Emacs trailer
37             ## Local variables:
38             ## coding: us-ascii
39             ## End:
40             ### conflict.pm ends here