use strict;
use Test::More tests => 33;

BEGIN { use_ok 'Location::GeoTool' }

my %testcase = (
  61 => 
  {
    4 => ['澎','E'],
    8 => ['颂澎','NE'],
    16 => ['澎颂澎','ENE'],
    32 => ['颂澎腮澎','NEbE']
  },
  124 => 
  {
    4 => ['澎','E'],
    8 => ['祁澎','SE'],
    16 => ['祁澎','SE'],
    32 => ['祁澎腮澎','SEbE']
  },
  247 => 
  {
    4 => ['谰','W'],
    8 => ['祁谰','SW'],
    16 => ['谰祁谰','WSW'],
    32 => ['谰祁谰','WSW']
  },
  324 => 
  {
    4 => ['颂','N'],
    8 => ['颂谰','NW'],
    16 => ['颂谰','NW'],
    32 => ['颂谰腮谰','NWbW']
  }
);

my $obj = Location::GeoTool->create_coord(35.12345,139.12345,'wgs84','degree');

foreach my $degree (keys %testcase)
{
  my $dir = $obj->direction_vector($degree,100);
  foreach my $mother (keys %{$testcase{$degree}})
  {
    my @string = @{$testcase{$degree}->{$mother}};
    is $dir->dir_string($mother,'jp'),$string[0];
    is $dir->dir_string($mother,'en'),$string[1];
  }
}

