| 1 |
use strict; |
| 2 |
use warnings; |
| 3 |
use Test::More; |
| 4 |
use Geo::Hash; |
| 5 |
|
| 6 |
# The test data are introduced from |
| 7 |
# http://github.com/masuidrive/pr_geohash/blob/master/test/test_pr_geohash.rb |
| 8 |
|
| 9 |
my %tests = ( |
| 10 |
'c216ne' => [ |
| 11 |
[ 45.37353515625, 45.3680419921875 ], |
| 12 |
[ -121.695556640625, -121.70654296875 ] |
| 13 |
], |
| 14 |
'dqcw4' => [ |
| 15 |
[ 39.0673828125, 39.0234375 ], |
| 16 |
[ -76.5087890625, -76.552734375 ] |
| 17 |
], |
| 18 |
); |
| 19 |
|
| 20 |
my $gh = Geo::Hash->new; |
| 21 |
for (keys %tests) { |
| 22 |
is_deeply [$gh->decode_to_interval($_)], $tests{$_}; |
| 23 |
} |
| 24 |
|
| 25 |
done_testing; |