blib/lib/CGI/Application/Plugin/Authentication/Driver/Filter/strip.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
statement | 12 | 12 | 100.0 |
branch | 2 | 2 | 100.0 |
condition | n/a | ||
subroutine | 5 | 5 | 100.0 |
pod | 2 | 2 | 100.0 |
total | 21 | 21 | 100.0 |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | package CGI::Application::Plugin::Authentication::Driver::Filter::strip; | ||||||
2 | |||||||
3 | 1 | 1 | 20899 | use strict; | |||
1 | 2 | ||||||
1 | 35 | ||||||
4 | 1 | 1 | 6 | use warnings; | |||
1 | 2 | ||||||
1 | 192 | ||||||
5 | our $VERSION = '0.20'; | ||||||
6 | |||||||
7 | sub check { | ||||||
8 | 2 | 100 | 2 | 1 | 6 | return ( _strip( $_[2] ) eq $_[3] ) ? 1 : 0; | |
9 | } | ||||||
10 | |||||||
11 | sub filter { | ||||||
12 | 1 | 1 | 1 | 19 | return _strip( $_[2] ); | ||
13 | } | ||||||
14 | |||||||
15 | sub _strip { | ||||||
16 | 3 | 3 | 5 | my $str = shift; | |||
17 | 3 | 14 | $str =~ s/^\s+//; | ||||
18 | 3 | 12 | $str =~ s/\s+$//; | ||||
19 | 3 | 19 | return $str; | ||||
20 | } | ||||||
21 | |||||||
22 | 1; | ||||||
23 | __END__ |