Changeset 4371

Show
Ignore:
Timestamp:
01/10/08 18:34:42 (5 years ago)
Author:
clouder
Message:

lang/perl/HTTP-MobileAgent?-Plugin-Locator: modified regexp to cut off gps uncompliant models 903i(TV|X)

Location:
lang/perl/HTTP-MobileAgent-Plugin-Locator/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/HTTP-MobileAgent-Plugin-Locator/trunk/lib/HTTP/MobileAgent/Plugin/Locator.pm

    r4354 r4371  
    1010our $VERSION = '0.01'; 
    1111 
    12 our $DOCOMO_GPS_COMPLIANT_MODELS = qr/(?:90[345]|SA[78]0[02]i)/; 
     12our $DOCOMO_GPS_COMPLIANT_MODELS = qr/(?:903i(?!TV|X)|(?:90[45]|SA[78]0[02])i)/; 
    1313 
    1414sub import { 
  • lang/perl/HTTP-MobileAgent-Plugin-Locator/trunk/t/02.gps_comliant.t

    r2652 r4371  
    88    my $agent = HTTP::MobileAgent->new; 
    99    ok $agent->gps_compliant, "docomo gps"; 
     10} 
     11 
     12{ 
     13    local $ENV{HTTP_USER_AGENT} = 'DoCoMo/2.0 P903i(c100;TB;W24H16)'; 
     14    my $agent = HTTP::MobileAgent->new; 
     15    ok $agent->gps_compliant, "docomo gps"; 
     16} 
     17 
     18{ 
     19    local $ENV{HTTP_USER_AGENT} = 'DoCoMo/2.0 P903iTV(c100;TB;W24H16)'; 
     20    my $agent = HTTP::MobileAgent->new; 
     21    ok !$agent->gps_compliant, "not compliant docomo gps"; 
     22} 
     23 
     24{ 
     25    local $ENV{HTTP_USER_AGENT} = 'DoCoMo/2.0 P903iX(c100;TB;W24H16)'; 
     26    my $agent = HTTP::MobileAgent->new; 
     27    ok !$agent->gps_compliant, "not compliant docomo gps"; 
    1028} 
    1129