Branch Coverage

blib/lib/HTML/ParseBrowser.pm
Criterion Covered Total %
branch 97 116 83.6


line true false branch
45 1 47 unless $useragent
46 0 47 if $useragent eq '-'
56 29 46 if defined $browser->{'detail'}
60 46 1 if (defined $browser->{'detail'})
66 7 40 if ($ua_string =~ /(iPhone|iPad|iPod).*?OS\s+(\d+_\d(_\d)?)/) { }
2 38 elsif ($ua_string =~ m[\((BlackBerry|BB10).*Version/([0-9\.]+)]) { }
1 37 elsif ($ua_string =~ m[Mozilla/5.0 \(.*?Windows.*?; rv:((\d+)\.(\d+))\) like Gecko]) { }
1 36 elsif ($useragent =~ m[OPR/((\d+)\.(\d+)\.\d+\.\d+)]) { }
4 32 elsif ($useragent =~ m[\bVersion/((\d+)\.(\d+)\S*) Safari/]) { }
2 30 elsif ($useragent =~ m[Opera/.*Version/((\d+)\.(\d+)\S*)$]) { }
70 7 0 if ($useragent =~ m[(Version|CriOS)/((\d+)(\.(\d+)[\.0-9]*)?)])
71 1 6 if ($1 eq 'CriOS')
76 7 0 if defined $5 and $5 ne ''
83 2 0 if ($version_string =~ /^([0-9]+)(\.([0-9]+).*)?/)
86 2 0 if defined $3 and $3 ne ''
113 0 76 if $br eq 'CriOS'
114 70 6 if ($br ne 'Safari' or not $seenchrome)
117 62 8 if ($ver =~ /^v?(\d+)\.(\d+)/)
121 6 70 if lc $br eq 'chrome'
122 1 75 if lc $br eq 'iron'
123 1 74 if lc $br eq 'lynx'
125 3 71 if lc $br eq 'opera'
130 9 198 if /compatible/i
132 179 19 unless (defined $browser->{'name'} and lc $browser->{'name'} eq 'webtv' || lc $browser->{'name'} eq 'opera')
133 6 173 if (/^MSIE (.*)$/)
141 0 198 if (m[^Edge/(([0-9]+)\.([0-9]+))])
148 1 197 if (/^AOL ([0-9].*)/)
154 1 197 if (m[^Konqueror/([-0-9.a-z]+)])
160 0 0 if m[\bCamino/([0-9.]+)] and do { $browser->{'name'} = 'Camino'; $browser->{'version'}{'v'} = $1; ($browser->{'version'}{'major'}, $browser->{'version'}{'minor'}) = split(/\./, $browser->{'version'}{'v'}, 2) }
166 1 197 if (m[^Opera Mini/([0-9.]+)])
172 24 174 if (/^Win/)
174 1 23 /phone/i ? :
175 18 6 if (/Windows NT\s*((\d+)(\.\d+)?)/ or /^WinNT((\d+)(\.\d+)?)/) { }
1 5 elsif (/Windows (?:Phone )?(\d+(\.\d+)?)/) { }
5 0 elsif (/Win(\w\w)/i) { }
178 1 17 if ($version >= 10) { }
1 16 elsif ($version >= 6.3 and $version < 7) { }
1 15 elsif ($version >= 6.2) { }
5 10 elsif ($version >= 6.1) { }
0 10 elsif ($version >= 6.06) { }
5 5 elsif ($version >= 6) { }
5 0 elsif ($version >= 5.1) { }
0 0 elsif ($version >= 5) { }
206 7 191 if (/^Mac/)
212 0 198 if (/^PPC$/)
217 3 195 if (/Android\s([\.0-9]+)/ and lc $browser->{'name'} ne 'edge') { }
8 187 elsif (/^Linux/) { }
225 4 4 if ($lstr =~ s/(i386|mips|amd64|sparc64|ppc|i686|i586|armv51|x86|x86-64|x86_64|ppc64|x64|x64_64)\b//)
228 0 8 if ($lstr =~ / (\d+\.\S+)/)
233 1 197 if (/^(SunOS|Solaris)/i)
236 1 0 if (/(sun4[a-z]|i86pc)/)
239 1 0 if (/^SunOS\s*([0-9\.]+)/)
244 21 177 if (/^($langRE)-/ or /^($langRE)$/)
251 8 39 if (defined $browser->{'name'} and exists $name_map{$browser->{'name'}})
257 1 46 if ($browser->{'name'} eq 'Konqueror')
267 23 24 if (int keys %langs_in > 0)
283 172 79 if (exists $self->{$method}) { }
79 0 elsif (exists $self->{'version'}{$method}) { }