File: 004_decode_to_interval.t

package info (click to toggle)
libgeo-hash-xs-perl 0.00015-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 412 kB
  • sloc: perl: 1,981; ansic: 55; makefile: 3
file content (25 lines) | stat: -rw-r--r-- 544 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
use strict;
use warnings;
use Test::More;
use Geo::Hash::XS;

# The test data are introduced from 
# http://github.com/masuidrive/pr_geohash/blob/master/test/test_pr_geohash.rb

my %tests = (
    'c216ne' => [
        [ 45.37353515625, 45.3680419921875 ],
        [ -121.695556640625, -121.70654296875 ] 
    ],
    'dqcw4' => [
        [ 39.0673828125, 39.0234375 ],
        [ -76.5087890625, -76.552734375 ]
    ],
);

my $gh = Geo::Hash::XS->new;
for (keys %tests) {
    is_deeply [$gh->decode_to_interval($_)], $tests{$_};
}

done_testing;