File: 005_precision.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 (17 lines) | stat: -rw-r--r-- 462 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use strict;
use warnings;
use Test::More;
use Geo::Hash::XS;

my $gh = Geo::Hash::XS->new;
is $gh->precision('45', '-120'), 4;
is $gh->precision('45.0', '-120'), 5;
is $gh->precision('45', '-120.0'), 5;
is $gh->precision('45.00', '-120'), 6;
is $gh->precision('45', '-120.00'), 6;
is $gh->precision('45.000', '-120'), 7;
is $gh->precision('45', '-120.000'), 8;
is $gh->precision('45.00000', '-120'), 10;
is $gh->precision('45', '-120.00000'), 10;

done_testing;