Show
Ignore:
Timestamp:
03/01/08 19:42:36 (5 years ago)
Author:
chiba
Message:

lang/perl/HTTP-MobileAgent?-Plugin-Locator: implement get_locator from params

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/HTTP-MobileAgent-Plugin-Locator/branches/get_locator_from_params/t/01.get_location.t

    r4137 r7333  
    1313    is_deeply( { lat => $location->lat, lng => $location->lng  }, 
    1414               { lat => '35.21.03.342', lng => '138.34.45.725' } ); 
     15     
     16    # BasicLocation on GPS compliant device 
     17    $location = $agent->get_location( { 
     18        AREACODE => '05902', LAT => '+35.39.43.538', LON => '+139.44.06.232', GEO => 'wgs84', XACC => 1  
     19    } ); 
     20    is ref $location, 'Geo::Coordinates::Converter::Point'; 
     21    is_deeply( { lat => $location->lat, lng => $location->lng  }, 
     22               { lat => '35.39.43.538', lng => '139.44.06.232' } ); 
     23     
     24    $location = $agent->get_location( { 
     25        AREACODE => '05902' 
     26    } ); 
     27    is ref $location, 'Geo::Coordinates::Converter::Point'; 
     28    is_deeply( { lat => $location->lat, lng => $location->lng  }, 
     29               { lat => '35.39.43.535', lng => '139.44.06.233' } ); 
    1530} 
    1631 
     
    4358    is_deeply( { lat => $location->lat, lng => $location->lng  }, 
    4459               { lat => '35.21.03.342', lng => '138.34.45.725' } ); 
     60 
     61    # BasicLocation on GPS compliant device 
     62    $location = $agent->get_location( { lat => '35.21.03.342', lon => '138.34.45.725' } ); 
     63    is ref $location, 'Geo::Coordinates::Converter::Point'; 
     64    is_deeply( { lat => $location->lat, lng => $location->lng  }, 
     65               { lat => '35.21.03.342', lng => '138.34.45.725' } ); 
    4566} 
    4667 
     
    4869    local $ENV{HTTP_USER_AGENT} = 'KDDI-CA31 UP.Browser/6.2.0.7.3.129 (GUI) MMP/2.0'; 
    4970    my $agent = HTTP::MobileAgent->new; 
    50     my $location = $agent->get_location( { lat => '+35.21.03.342', lon => '+138.34.45.725' } ); 
     71    my $location = $agent->get_location( { lat => '35.21.03.342', lon => '138.34.45.725' } ); 
    5172    is ref $location, 'Geo::Coordinates::Converter::Point'; 
    5273    is_deeply( { lat => $location->lat, lng => $location->lng  }, 
     
    6182    is_deeply( { lat => $location->lat, lng => $location->lng  }, 
    6283               { lat => '35.21.03.342', lng => '138.34.45.725' } ); 
     84     
     85 
     86    # BasicLocation on GPS compliant device 
     87    local $ENV{ HTTP_X_JPHONE_GEOCODE } = '352051%1a1383456%1afoo'; 
     88    $location = $agent->get_location(); 
     89    is ref $location, 'Geo::Coordinates::Converter::Point'; 
     90    is_deeply( { lat => $location->lat, lng => $location->lng  }, 
     91               { lat => '35.21.02.678', lng => '138.34.44.820' } ); 
    6392} 
    6493