1 # This is -*-Perl-*- code#
2 # Bioperl Test Harness Script for Modules
3 # $Id: protgraph.t,v 1.1 2004/03/13 23:45:32 radams Exp
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 module needed for the bioperl-network package, skipping tests";
29 foreach ( $Test::ntest..$NUMTESTS) {
30 skip("Missing dependencies. Skipping tests",1);
34 exit 0 if $ERROR == 1;
36 require Bio::Network::ProteinNet;
37 require Bio::Network::Edge;
38 require Bio::Network::Node;
42 $verbose = 1 if $DEBUG;
46 my $seq1 = Bio::Seq->new(-seq => "aaaaaaa");
47 my $seq2 = Bio::Seq->new(-seq => "ttttttt");
48 my $seq3 = Bio::Seq->new(-seq => "ccccccc");
50 my $node1 = Bio::Network::Node->new(-protein => $seq1);
51 my $node2 = Bio::Network::Node->new(-protein => [($seq2,$seq3)]);
53 my $edge = Bio::Network::Edge->new(-nodes => [($node1,$node2)]);
55 my $count = $edge->nodes;
58 my @nodes = $edge->nodes;
61 # suppose that it's possible to construct an Edge with 1 Node,
62 # interacting with itself
63 $edge = Bio::Network::Edge->new(-nodes => [($node1)]);
65 $count = $edge->nodes;
68 @nodes = $edge->nodes;