1 # This is -*-Perl-*- code#
2 # Bioperl Test Harness Script for Modules#
5 use vars qw($NUMTESTS $DEBUG $ERROR);
7 $DEBUG = $ENV{'BIOPERLDEBUG'} || 0;
10 # to handle systems with no installed Test module
11 # we include the t dir (where a copy of Test.pm is located)
13 eval { require Test; };
20 plan tests => $NUMTESTS;
21 eval { require Graph; };
23 warn("Graph required for graph creation and analysis, skipping tests");
26 eval { require XML::Twig; };
28 warn "XML::Twig needed for XML format parsing, skipping tests";
34 foreach ( $Test::ntest..$NUMTESTS) {
35 skip("Missing dependencies. Skipping tests",1);
39 exit 0 if $ERROR == 1;
41 require Bio::Network::IO;
44 $verbose = 1 if $DEBUG;
51 ok my $io = Bio::Network::IO->new
53 -file => Bio::Root::IO->catfile("t", "data", "human_small-01.xml"),
54 -verbose => $verbose );
55 ok my $g1 = $io->next_network();
56 ok $g1->node_count, 646;
57 # remember that interactions are only formed of pairs of nodes
58 ok $g1->interactions, 439;
62 ok $io = Bio::Network::IO->new
64 -file => Bio::Root::IO->catfile("t", "data", "Viruses.psi25.xml"),
65 -verbose => $verbose );
66 ok $g1 = $io->next_network();
67 ok $g1->node_count, 521;
68 ok $g1->interactions, 994;