xt/compat/005_precision.t
raw| 1 | use strict; |
| 2 | use warnings; |
| 3 | use Test::More; |
| 4 | use Geo::Hash; |
| 5 | |
| 6 | my $gh = Geo::Hash->new; |
| 7 | is $gh->precision('45', '-120'), 4; |
| 8 | is $gh->precision('45.0', '-120'), 5; |
| 9 | is $gh->precision('45', '-120.0'), 5; |
| 10 | is $gh->precision('45.00', '-120'), 6; |
| 11 | is $gh->precision('45', '-120.00'), 6; |
| 12 | is $gh->precision('45.000', '-120'), 7; |
| 13 | is $gh->precision('45', '-120.000'), 8; |
| 14 | is $gh->precision('45.00000', '-120'), 10; |
| 15 | is $gh->precision('45', '-120.00000'), 10; |
| 16 | |
| 17 | done_testing; |