File Coverage

xt/lib/Local/FalseThing.pm
Criterion Covered Total %
statement 15 16 93.7
branch n/a
condition n/a
subroutine 6 7 85.7
pod 0 1 0.0
total 21 24 87.5


line stmt bran cond sub pod time code
1             # vim: ts=4 sts=4 sw=4 et: syntax=perl
2             #
3             # Copyright (c) 2021-2023 Sven Kirmess
4             #
5             # Permission to use, copy, modify, and distribute this software for any
6             # purpose with or without fee is hereby granted, provided that the above
7             # copyright notice and this permission notice appear in all copies.
8             #
9             # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10             # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11             # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12             # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13             # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14             # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15             # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16              
17 2     2   230685 use 5.006;
  2         28  
18 2     2   12 use strict;
  2         2  
  2         52  
19 2     2   10 use warnings;
  2         12  
  2         182  
20              
21             package Local::FalseThing;
22              
23             our $VERSION = '0.001';
24              
25             use overload (
26             q("") => '_stringify',
27 0     0   0 bool => sub () { return 0 },
28 2         19 fallback => 1,
29 2     2   2479 );
  2         1926  
30              
31             sub new {
32 2     2 0 46 my ( $class, $path ) = @_;
33              
34 2         25 return bless { _thing => $path }, $class;
35             }
36              
37             sub _stringify {
38 2     2   14 my ($self) = @_;
39              
40 2         44 return $self->{_thing};
41             }
42              
43             1;