Branch Coverage

blib/lib/Geo/Google.pm
Criterion Covered Total %
branch 16 100 16.0


line true false branch
203 0 0 if (not defined $msg && $self->isa('Geo::Google')) { }
237 0 1 unless my $address = $arg{'address'}
245 0 0 if ($pages[0] =~ /did\snot\smatch\sany\slocations/i) { }
0 0 elsif ($pages[0] =~ /Did you mean:/is) { }
246 0 0 if $self->error("Google couldn't find any locations matching $address.")
262 0 0 if (scalar @pages > 0) { }
265 0 0 if ($page =~ m#loadVPage\((.+), "\w+"\);}//]]>#is) { }
267 0 0 if $self->error(q[Unable to locate the JSON format data in google's response.])
269 0 0 if (scalar @{$$response_json{'overlays'}{'markers'};} > 0) { }
276 0 0 if $self->error('Found the JSON Data block and was able to parse it, but it had no location markers in it. Maybe Google changed their JSON data structure?.')
282 0 0 if $self->error("Google couldn't resolve the address $address but suggested alternate addresses. " . 'I attempted to download them but failed.')
310 0 0 if ($page =~ /did\snot\smatch\sany\slocations/i) { }
0 0 elsif ($page =~ m#loadVPage\((.+), "\w+"\);}//]]>#is) { }
311 0 0 if $self->error("Google couldn't find a $query near " . $where->title)
319 0 0 if $self->error(q[Unable to locate the JSON format data in Google's response.])
322 0 0 if (scalar @{$$response_json{'overlays'}{'markers'};} > 0) { }
331 0 0 if $self->error('Found the JSON Data block and was able to parse it, but it had no location markersin it. Maybe Google changed their JSON data structure?')
355 0 0 if (scalar @locations < 2)
361 0 0 unless ($locations[$i]->isa('Geo::Google::Location'))
378 0 0 if ($page =~ /did\snot\smatch\sany\slocations/i) { }
0 0 elsif ($page =~ /didyou/s) { }
379 0 0 if $self->error(q[Google couldn't find one of the locations you provided for your directions query])
397 0 0 if ($page =~ m#loadVPage\((.+), "\w+"\);}//]]>#s) { }
402 0 0 if $self->error(q[Unable to locate the JSON format data in Google's response.])
427 0 0 if ($subpath =~ /ddwpt_table/s and not $segment =~ /ddptlnk/s)
434 0 0 unless (defined $id)
435 0 0 if ($subpath =~ /waypoint="(.+?)"/s)
442 0 0 unless $id
444 0 0 unless ($time)
468 0 0 if ($stepsfound == 0)
469 0 0 if $self->error('Found the HTML directions from the JSON reponse, but was not able to extract the driving directions from the HTML')
521 0 0 if ($lat == $locations[$j]->latitude and $lon == $locations[$j]->longitude)
526 0 0 if ($pointislocation >= 0) { }
531 0 0 if ($html_segs[1]) { }
0 0 elsif ($html_segs[0]) { }
534 0 0 if (defined $html_segs[1]{'pointIndex'})
535 0 0 unless $m == $html_segs[1]{'pointIndex'} and $#html_segs > 1 or not @pointset
551 0 0 if $pointset[0]
588 0 0 if ($$response_json{'printheader'} =~ m[(\d+\.?\d*)\s*(mi|km|m)\s*about\s*(.+?)
$]s) { } 598 0 0 if $self->error(q[Could not extract the total route distance and time from google's directions]) 634 6 17 if (ord $quintets[$i] < 95) { } 640 4 2 if ($final_number % 2 > 0) 658 0 1 unless defined $quintets 685 2 1 if (length $word >= 1 and ord $quintets[$i] <= 95) 686 1 1 if ($lastlat > $lastlong) { } 718 2 2 if ($i > 1) { } 748 4 2 if ($signed_int < 0) { } 757 6 17 if ($unsigned_int < 32) { } 807 0 0 if ($$marker{'infoWindow'}{'type'} eq 'html') { } 808 0 0 if ($$marker{'laddr'} =~ /\((.+)\)\s\@\-?\d+\.\d+,\-?\d+\.\d+$/s) { }