summaryrefslogtreecommitdiff
path: root/t/01-lookup.t
blob: ad780e225a19889e7793ee6efb085a63e16dda53 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!perl -T

use Test::More tests => 2;
use Data::Dumper;
use Geo::USCensus::Geocoding;

diag( "Testing lookup of a known good address" );
my $result = Geo::USCensus::Geocoding->query(
  street  => '1400 J St', # the Sacramento Convention Center
  city    => 'Sacramento',
  state   => 'CA',
  zip     => '95814',
);

is( $result->message, '', 'error status' );
is( $result->matches, 1, 'number of matches' );
diag($result->match(0)->matchedAddress);
diag('Census tract '.$result->match(0)->censustract);