more work on tests
This commit is contained in:
parent
647cd0923b
commit
b9b7771ce5
|
@ -72,3 +72,22 @@ my $res=[ '0', '1',
|
|||
],
|
||||
}
|
||||
];
|
||||
|
||||
# does a quick test to make sure we have the basics required for the following tests to work
|
||||
my $res_good=1;
|
||||
if (
|
||||
( ref( $res ) ne 'ARRAY' ) ||
|
||||
( ! defined( $res->[2] ) ) ||
|
||||
( ! defined( $res->[2]->{active_conns} ) )
|
||||
){
|
||||
$res_good=0;
|
||||
}
|
||||
ok( $res_good eq '1', 'res test') or diag("Test data is bad");
|
||||
|
||||
my $search=Parse::Netstat::Search->new;
|
||||
|
||||
#return all non-unix connections
|
||||
my @found=$search->search($res);
|
||||
ok( $#found eq '5', 'search, all') or diag('"'.$#found.'" number of returned connections for a empty search instead of "5"');
|
||||
|
||||
done_testing(3);
|
||||
|
|
Loading…
Reference in New Issue