[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.1 and 1.2

version 1.1, 2010/06/26 17:33:33 version 1.2, 2010/06/26 17:47:01
Line 1 
Line 1 
 #!perl  #!perl
 package NetworkTests;  package NetworkTests;
 # $AFresh1$  
   
   # $AFresh1: network_tests.t,v 1.1 2010/06/26 16:33:33 andrew Exp $
   
 use strict;  use strict;
 use warnings;  use warnings;
   
 use Test::More;  use Test::More;
 use Net::OpenAMD;  use Net::OpenAMD;
   
 if (!caller()) {  if ( !caller() ) {
     if ($ENV{'NETWORK_TESTS'}) {      if ( $ENV{'NETWORK_TESTS'} ) {
         # plan tests => ??;  
           # plan tests => ??;
     }      }
     else {      else {
         plan skip_all => "Set env NETWORK_TESTS to test"          plan skip_all => "Set env NETWORK_TESTS to test";
     }      }
   
     my $amd = Net::OpenAMD->new();      my $amd = Net::OpenAMD->new();
Line 27 
Line 29 
 sub run_tests {  sub run_tests {
     my ($amd) = @_;      my ($amd) = @_;
   
     ok(1);      my %tests = (
           location => [
               {   args   => undef,
                   expect => {},
               },
           ],
           speakers => [
               {   args   => undef,
                   expect => {},
               },
           ],
           talks => [
               {   args   => undef,
                   expect => {},
               },
           ],
           interests => [
               {   args   => undef,
                   expect => {},
               },
           ],
           users => [
               {   args   => undef,
                   expect => {},
               },
           ],
           stats => [
               {   args   => undef,
                   expect => {},
               },
           ],
       );
   
       foreach my $method ( keys %tests ) {
           foreach my $test ( @{ $tests{$method} } ) {
               no warnings 'uninitialized';
               my $result;
               eval { $result = $amd->$method( $test->{args} ) };
               is( $@,      undef,           "$method($test->{args})" );
               is( $result, $test->{expect}, 'got expected result' );
           }
       }
 }  }

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

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