File Coverage

blib/lib/Duadua/Parser/Browser/Yandex.pm
Criterion Covered Total %
statement 16 16 100.0
branch 5 6 83.3
condition 2 3 66.6
subroutine 4 4 100.0
pod 1 1 100.0
total 28 30 93.3


line stmt bran cond sub pod time code
1             package Duadua::Parser::Browser::Yandex;
2 11     11   65 use strict;
  11         20  
  11         445  
3 11     11   51 use warnings;
  11         30  
  11         518  
4 11     11   55 use Duadua::Util qw//;
  11         20  
  11         2414  
5              
6             sub try {
7 143     143 1 313 my ($class, $d) = @_;
8              
9 143 100 66     308 if ( $d->_contain(' YaBrowser/') && $d->_contain_mozilla ) {
10 2         9 my $h = {
11             name => 'Yandex Browser',
12             };
13              
14 2 100       7 if ($d->opt_version) {
15 1         5 my ($version) = ($d->ua =~ m! YaBrowser/([\d.]+)!);
16 1 50       7 $h->{version} = $version if $version;
17             }
18              
19 2         12 return Duadua::Util->set_os($d, $h);
20             }
21             }
22              
23             1;
24              
25             __END__