Branch Coverage

blib/lib/Parse/HTTP/UserAgent/Base/Parsers.pm
Criterion Covered Total %
branch 266 334 79.6


line true false branch
9 190 0 ref $_ eq 'ARRAY' ? :
13 186 476 if (my(@match) = $e =~ / \A [.]NET (?: \s+ CLR \s+ )? (.+?) \z /msx)
17 180 296 if ($e =~ / \A Win(dows|NT|[0-9]+)? /imsx)
18 178 2 if ($1 and $1 ne '64')
32 22 26 unless $self->[6]
35 12 44 if ($e =~ m[ \A (Opera \s+ Mini) / (.+?) \z ]msx)
45 24 2 @buf ? :
51 2 58 if (${$v_ref;} and not ${$v_ref;} =~ / [0-9] /msx)
56 8 52 if (${$os_ref;} and ${$os_ref;} =~ m[ http:// ]msx)
71 10 34 if ($is_30) { }
75 10 10 if (index($others[$i], 'Maxthon') != -1)
92 36 262 if (index(uc $e, 'MAXTHON') != -1)
96 46 216 if (index(uc $e, 'MSIE') != -1)
105 0 44 unless ($maxthon)
111 10 34 if ($is_30) { }
112 4 6 if ($self->[8])
118 0 34 unless ($msie)
128 10 34 $is_30 ? :
131 22 0 $maxthon ? :
22 22 $mv ? :
146 2 168 if (@{$extras;} == 2 and index($extras->[1], 'Lunascape') != -1)
152 76 94 if @{$dotnet;}
154 6 164 if ($extras->[0] and $extras->[0] eq 'Mac_PowerPC')
161 44 244 if (index($e, 'Trident/') != -1)
164 44 0 if ($tk_name eq 'Trident' and $tk_version)
165 2 42 if ($tk_version eq '7.0' and $self->[25] ne '11.0') { }
4 38 elsif ($tk_version eq '6.0' and $self->[25] ne '10.0') { }
188 4 226 lc $thing eq 'touch' ? :
200 104 66 @extras ? :
209 10 2 if (ref $extra eq 'ARRAY') { }
211 10 10 if $_ ne 'like'
219 12 44 if (index($e, 'rv:') != -1)
226 0 12 unless $self->_parse_msie(undef, $thing, $extra, 'MSIE', $version)
228 2 0 if ($self->[22] and $self->[6])
232 2 0 $_ eq 'ARM' ? :
238 0 2 @extras ? :
250 10 36 if (ref $e eq 'ARRAY' and @{$e;} > 0 and index(lc $e->[-1], 'fennec') != -1)
280 10 0 unless $self->[8]
282 0 0 if (lc $self->[8] eq 'tablet') { }
0 0 elsif (index($self->[8], ' ') != -1) { }
305 12 54 if ($ipad)
307 4 8 if ($junkv and $junkv eq 'Mobile')
315 12 50 $ipad ? :
4 62 $ep ? :
319 66 0 $extra ? :
320 36 30 if ($thing->[-1] and length $thing->[-1] <= 5)
327 64 2 @{$thing;} && length $thing->[-1] > 1 ? :
329 0 66 if ($self->[14] and lc $self->[14] eq 'macintosh')
334 6 60 if ($thing->[0] and lc $thing->[0] eq 'iphone')
339 2 4 if ($check_os and index($check_os, 'Mac OS X') != -1)
340 2 0 if ($self->[14])
345 2 0 if (not $self->[8] and $self->[21])
347 2 0 if ($v and $v =~ / [a-zA-Z]{2}_[a-zA-Z]{2} /msx)
358 0 66 if ($self->[14] and length $self->[14] == 1)
363 2 64 if ($self->[8] and not $self->[8] =~ /[a-zA-Z]+/gmsx)
369 28 38 if @junk
370 66 0 if $extra
372 66 0 @extras ? :
382 4 16 if ($rest[0] and index($rest[0], 'OPR/', 0) != -1) { }
384 4 0 if (ref $extra eq 'ARRAY')
394 4 16 $opera ? :
402 2 0 if (not $extra and $others[0] and index($others[0], 'AppleWebKit') != -1)
409 42 0 if $extra
414 38 220 if ($junk eq 'Mobile')
418 42 178 if (index($junk, 'Version') != -1)
426 42 0 if ($self->[4])
432 42 0 if @build
433 40 2 @build ? :
436 40 2 if ($device and $build)
441 0 40 if (@btest)
447 42 0 if (@extras >= 3 and $extras[0] and $extras[0] eq 'KHTML,')
455 38 4 $is_phone ? :
456 42 0 @extras_final ? :
465 2 34 @{$thing;} && index($thing->[-1], 'rv:') != -1 ? :
468 2 34 if $name ne 'Opera'
473 22 12 if ($extra)
478 10 12 $swap ? :
479 10 12 if ($swap)
481 10 0 if $vjunk
485 2 32 if $ffaker
492 16 18 if ($tk_parsed_as_lang)
494 16 0 if $extra
499 24 10 if (@{$thing;} and $self->_is_strength($thing->[-1])) { }
507 22 12 $extra ? :
509 20 14 @extras ? :
517 8 6 if $compatible
522 6 8 if (@{$thing;} and $self->_is_strength($thing->[-1])) { }
530 14 0 $extra ? :
531 6 8 @extras ? :
538 78 22 defined $extra->[1] ? :
541 100 0 if ($version)
547 98 2 $extra->[0] ? :
551 90 10 if (@{$thing;} and index($thing->[-1], 'rv:') != -1)
554 0 90 if ($len_thing == 3) { }
24 66 elsif ($len_thing <= 2) { }
556 0 0 if ($self->[14] and $self->[14] eq 'Macintosh')
559 0 0 if @{$thing;}
562 12 12 if ($thing->[0] eq 'X11' or index($thing->[-1], 'Intel') != -1) { }
6 6 elsif (index(lc $thing->[0], 'android') != -1 or index(lc $thing->[0], 'maemo') != -1) { }
565 2 10 if (index(lc $thing->[-1], 'linux arm') != -1) { }
580 2 4 if (lc $self->[4] eq 'tablet')
585 4 2 if ($len_thing > 1) { }
586 2 2 if ($thing->[-1] ne 'WOW64')
605 100 0 $extra ? :
608 98 2 @extras ? :
618 50 0 if ($self->[11] and $self->[25])
621 6 44 if $self->[11] eq 'Netscape6'
622 2 48 if $self->[11] eq 'Beonex'
627 0 130 unless $e
628 46 84 if (my $s = $self->_is_strength($e))
632 4 80 if ($e =~ / \s i\d86 /msx)
634 4 0 if $os
635 2 2 if $lang
638 6 74 if (not $self->[14] and $e =~ / Win(?:NT|dows) /imsx)
642 2 72 if ($e =~ / \A [a-z]{2} \z /msx)
646 2 70 if ($e =~ m[ \A (Epiphany) / (.+?) \z ]imsx)
653 50 0 @buf ? :
654 8 42 if $before ne $self->[11]
659 0 0 if (ref $self->[21] eq 'ARRAY' and $self->[21][0] eq 'Gecko')
661 0 0 if ($self->[11] and $self->[25])
672 8 18 if ($self->[14] and length $self->[14] == 2)
683 22 6 if not $os || $skip_os or $os ne 'windows' and not $skip_os or ref $self->[6] ne 'ARRAY' or not $self->[6][0] or not $self->[6][0] =~ / NT\s?(\d.*?) \z /imsx
700 26 38 if (my $s = $self->_is_strength($e))
707 4 22 $buf[0] eq 'X11' ? :
709 12 14 @buf ? :
710 12 14 if ($junk)
712 12 0 if $junk
720 20 30 unless @{$t;}
722 6 24 if $mname eq 'Mozilla' or $mname eq 'Emacs-W3'
724 6 18 if (index($mname, 'Nokia') != -1)
727 4 0 if ($device and $num and $os and $series and index($os, 'SymbianOS') != -1)
742 10 8 $t->[0] && !($t->[0] =~ / \d+ [.]? \d /msx) ? :
2 18 @rest ? :
744 2 18 $extra ? :
750 16 4 @extras ? :
760 74 36 unless $ok
763 18 18 if (@moz == 1)
765 18 0 if ($name and $version)
780 48 44 unless $compatible and @{$thing;}
784 40 4 $mname eq 'Mozilla' ? :
787 4 36 if $thing->[0] and $thing->[0] eq $name || $thing->[0] eq $moz
793 4 40 if ($name eq 'MSIE')
794 0 4 if ($self->_is_generic_bogus_ie($extra)) { }
2 2 elsif ($extra) { }
806 2 0 if @{$dotnet;}
810 2 0 if index($moz, ' ') != -1
814 16 24 $extra ? :
40 2 unless @extras
816 2 40 if ($lang and index($lang, 'MSIE ') != -1)
831 24 16 @extras ? :
846 4 0 if $self->[14]
848 0 4 if $extra and ref $extra eq 'ARRAY'
849 0 4 if @others
851 4 0 @extras ? :
863 4 16 if (index($name, 'Symbian') != -1)
867 2 14 if ($name eq 'Mozilla' and @parts)
869 0 2 unless $name and $version
874 14 2 @parts ? :
876 0 16 unless $self->[25]
885 0 8 unless $os and $series_device
889 0 8 unless $device
896 8 0 @extras ? :
909 2 0 if ($parsable)
911 2 0 if (@parts > 2)
915 2 0 @parts ? :
923 2 0 if ($thing->[0] and index(lc $thing->[0], 'googlebot-mobile') != -1)
927 2 0 @{$thing;} > 0 ? :