aboutsummaryrefslogtreecommitdiffstats
path: root/t/Mock/MapIt.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2017-05-18 20:12:16 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2017-05-18 20:12:16 +0100
commit675744156c56d7b5ea5c8866fdd59a1c3cbcee1b (patch)
tree9ac7bb95f77ed5c473f9dd2a62be70959a4508b0 /t/Mock/MapIt.pm
parent61eb613ddc31943e9d6504050c0e96f91340f752 (diff)
[UK] Stop nearest request with scientific notation
If the longitude was very close to 0, it was being sent as e.g. 1e-6 in the request to MapIt. Mock out the Bing query so that this can be tested (the closest.t tests were previously always being skipped).
Diffstat (limited to 't/Mock/MapIt.pm')
-rw-r--r--t/Mock/MapIt.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/t/Mock/MapIt.pm b/t/Mock/MapIt.pm
index 0b355983b..24e7a8084 100644
--- a/t/Mock/MapIt.pm
+++ b/t/Mock/MapIt.pm
@@ -32,6 +32,7 @@ my @PLACES = (
[ 'GU51 4AE', 51.279456, -0.846216, 2333, 'Hart District Council', 'DIS', 2227, 'Hampshire County Council', 'CTY' ],
[ 'WS1 4NH', 52.563074, -1.991032, 2535, 'Sandwell Borough Council', 'MTD' ],
[ 'OX28 4DS', 51.784721, -1.494453 ],
+ [ 'E14 2DN', 51.508536, '0.000001' ],
);
sub dispatch_request {
@@ -112,7 +113,7 @@ sub dispatch_request {
foreach (@PLACES) {
if ($point eq "4326/$_->[2],$_->[1]") {
return $self->output({
- postcode => { wgs84_lat => $_->[1], wgs84_lon => $_->[2], postcode => $_->[0] },
+ postcode => { wgs84_lat => $_->[1], wgs84_lon => $_->[2], postcode => $_->[0], distance => 93 },
});
}
}