more work on tests

This commit is contained in:
Zane C. B-H 2019-02-20 02:27:42 -06:00
parent 647cd0923b
commit b9b7771ce5
1 changed files with 19 additions and 0 deletions

View File

@ -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);