aboutsummaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorlouise <louise>2009-09-15 18:00:39 +0000
committerlouise <louise>2009-09-15 18:00:39 +0000
commit29a92a67bb5d1c6f4e717c5c97a2d950d1af1fb5 (patch)
tree19f09a96a98b65b6ce6856d8968600ab09fec6b2 /t
parenteaa489f45960bd35c60a93997933b5a4551894bc (diff)
Update test code
Diffstat (limited to 't')
-rwxr-xr-xt/Page.t18
1 files changed, 9 insertions, 9 deletions
diff --git a/t/Page.t b/t/Page.t
index ea68e7419..44530b21f 100755
--- a/t/Page.t
+++ b/t/Page.t
@@ -6,12 +6,12 @@
# Copyright (c) 2009 UK Citizens Online Democracy. All rights reserved.
# Email: louise@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: Page.t,v 1.4 2009-09-15 17:42:43 louise Exp $
+# $Id: Page.t,v 1.5 2009-09-15 18:00:39 louise Exp $
#
use strict;
use warnings;
-use Test::More tests => 8;
+use Test::More tests => 15;
use Test::Exception;
use FindBin;
@@ -37,18 +37,18 @@ sub set_lang($) {
sub test_geocode_string() {
my %params = ();
- my $q = new MockQuery('mysite', \%params);
+ my $q = new MockQuery('nosite', \%params);
# geocode a straightforward string, expect success
my ($x, $y, $easting, $northing, $error) = Page::geocode_string('Buckingham Palace', $q);
- ok($x == 3279, 'example x coordinate generated');
- ok($y == 1113, 'example y coordinate generated');
- ok($easting == 529044, 'example easting generated');
- ok($northing == 179619, 'example northing generated');
-
+ ok($x == 3279, 'example x coordinate generated') or diag("Got $x");
+ ok($y == 1113, 'example y coordinate generated') or diag("Got $y");;
+ ok($easting == 529044, 'example easting generated') or diag("Got $easting");
+ ok($northing == 179619, 'example northing generated') or diag("Got $northing");
+ ok(! defined($error), 'should not generate error for simple example') or diag("Got $error");
# expect a failure message for Northern Ireland
($x, $y, $easting, $northing, $error) = Page::geocode_string('Falls Road, Belfast', $q);
- ok($error eq "We do not cover Northern Ireland, I'm afraid, as our licence doesn't include any maps for the region.", 'error message produced for NI location');
+ ok($error eq "We do not cover Northern Ireland, I'm afraid, as our licence doesn't include any maps for the region.", 'error message produced for NI location') or diag("Got $error");
}
sub test_header() {