[BACK]Return to network_tests.t CVS log [TXT][DIR] Up to [local] / HOPE / Net-OpenAMD / t

Diff for /HOPE/Net-OpenAMD/t/network_tests.t between version 1.2 and 1.5

version 1.2, 2010/06/26 17:47:01 version 1.5, 2010/06/28 21:40:38
Line 1 
Line 1 
 #!perl  #!perl
 package NetworkTests;  package NetworkTests;
   
 # $AFresh1: network_tests.t,v 1.1 2010/06/26 16:33:33 andrew Exp $  # $AFresh1: network_tests.t,v 1.4 2010/06/27 00:52:33 andrew Exp $
   
 use strict;  use strict;
 use warnings;  use warnings;
Line 15 
Line 15 
         # plan tests => ??;          # plan tests => ??;
     }      }
     else {      else {
         plan skip_all => "Set env NETWORK_TESTS to test";          plan skip_all => 'Network test.  Set $ENV{NETWORK_TESTS} to a true value to run.';
     }      }
   
     my $amd = Net::OpenAMD->new();      my $amd = Net::OpenAMD->new();
Line 32 
Line 32 
     my %tests = (      my %tests = (
         location => [          location => [
             {   args   => undef,              {   args   => undef,
                 expect => {},                  expect => [
                       {   'y'      => '83.1452331542969',
                           'area'   => 'Engressia',
                           'time'   => 2387,
                           'user'   => 12983,
                           'x'      => '46.7369918823242',
                           'button' => 'False'
                       }
                   ],
             },              },
         ],          ],
         speakers => [          speakers => [
             {   args   => undef,              {   args   => undef,
                 expect => {},                  expect => [
                       {   'name' => 'Johnny',
                           'bio'  => 'Johnny\'s bio'
                       },
                   ],
             },              },
         ],          ],
         talks => [          talks => [
             {   args   => undef,              {   args   => undef,
                 expect => {},                  expect => [
                       {   'speakers'  => [ 'Judas', 'JohnnyX' ],
                           'interests' => [ 'media', 'crypto' ],
                           'time'      => '2008/7/18 13:00:00',
                           'track'     => 'Hooper',
                           'title' => 'Ancient Egyptian Music and DRM',
                           'abstract' =>
                               'A discussion of the development of musical notation, which was designed as a means of reproducing music while making it impossible for the general public to perform without permission.'
                       }
                   ],
             },              },
         ],          ],
         interests => [          interests => [
             {   args   => undef,              {   args   => undef,
                 expect => {},                  expect => [
                       'new tech',           'activism',
                       'radio',              'lockpicking',
                       'crypto',             'privacy',
                       'ethics',             'telephones',
                       'social engineering', 'hacker spaces',
                       'hardware hacking',   'nostalgia',
                       'communities',        'science',
                       'government',         'network security',
                       'malicious software', 'pen testing',
                       'web',                'niche hacks',
                       'media',
                   ],
             },              },
         ],          ],
         users => [          users => [
             {   args   => undef,              {   args   => undef,
                 expect => {},                  expect => [
                       {   'name'      => 'JohnnyX',
                           'x'         => '32.54091324',
                           'y'         => '54.10958384',
                           'interests' => [
                               'new tech',           'radio',
                               'lockpicking',        'crypto',
                               'telephones',         'social engineering',
                               'hacker spaces',      'hardware hacking',
                               'nostalgia',          'communities',
                               'science',            'network security',
                               'malicious software', 'pen testing'
                           ],
                       }
                   ]
             },              },
         ],          ],
         stats => [          stats => [
             {   args   => undef,              {   args   => undef,
                 expect => {},                  expect => qr/^Unused \s feature/xms,
             },              },
         ],          ],
     );      );
Line 67 
Line 114 
             no warnings 'uninitialized';              no warnings 'uninitialized';
             my $result;              my $result;
             eval { $result = $amd->$method( $test->{args} ) };              eval { $result = $amd->$method( $test->{args} ) };
             is( $@,      undef,           "$method($test->{args})" );              if ( ref $test->{expect} eq 'Regexp' ) {
             is( $result, $test->{expect}, 'got expected result' );                  like( $@, $test->{expect}, "AMD->$method($test->{args})" );
               }
               elsif ( ref $test->{expect} ) {
                   is( $@, '', "AMD->$method($test->{args})" );
                   is_deeply( $result, $test->{expect}, 'got expected result' );
               }
               else {
                   is( $@, $test->{expect}, "AMD->$method($test->{args})" );
               }
         }          }
     }      }
 }  }

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.5

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>