File Coverage

blib/lib/Gears/Router/Pattern/Match.pm
Criterion Covered Total %
statement 19 19 100.0
branch 6 6 100.0
condition n/a
subroutine 4 4 100.0
pod 2 2 100.0
total 31 31 100.0


line stmt bran cond sub pod time code
1             package Gears::Router::Pattern::Match;
2             $Gears::Router::Pattern::Match::VERSION = '0.101';
3 1     1   14 use v5.40;
  1         5  
4 1     1   6 use Mooish::Base -standard;
  1         3  
  1         12  
5              
6             extends 'Gears::Router::Pattern';
7              
8 237         310 sub compare ($self, $request_path)
9 237     237 1 7244 {
  237         345  
  237         277  
10 237         4087 my $pattern = $self->pattern;
11              
12 237 100       10219 if ($self->is_bridge) {
13             return undef
14 206 100       3900 unless scalar $request_path =~ m/^\Q$pattern\E/;
15             }
16             else {
17             return undef
18 31 100       194 unless $request_path eq $pattern;
19             }
20              
21             # this pattern does not really match anything other than the pattern itself
22             # - return empty (but defined) list of matches
23 211         863 return [];
24             }
25              
26 1         3 sub build ($self, @more_args)
27 1     1 1 4739 {
  1         3  
  1         2  
28 1         29 return $self->pattern;
29             }
30              
31             __END__