1 # This is -*-Perl-*- code
2 ## Bioperl Test Harness Script for Modules
6 # Before `make install' is performed this script should be runnable with
7 # `make test'. After `make install' it should work as `perl test.t'
10 use vars qw($NUMTESTS $DEBUG);
11 $DEBUG = $ENV{'BIOPERLDEBUG'} || 0;
15 # to handle systems with no installed Test module
16 # we include the t dir (where a copy of Test.pm is located)
18 eval { require Test; };
26 plan tests => $NUMTESTS;
27 eval { require IO::String;
28 require LWP::UserAgent;
29 require HTTP::Request::Common;
32 for( $Test::ntest..$NUMTESTS ) {
33 skip("IO::String,LWP::UserAgent, or HTTP::Request::Common not installed. This means the Bio::DB::* modules are not usable. Skipping tests",1);
40 for ( $Test::ntest..$NUMTESTS ) {
41 skip("Unable to complete RefSeq tests - set env variable BIOPERLDEBUG to test",1);
49 require Bio::DB::RefSeq;
50 require Bio::DB::GenBank;
51 require Bio::DB::EMBL;
56 ## End of black magic.
58 ## Insert additional test code below but remember to change
59 ## the print "1..x\n" in the BEGIN block to reflect the
60 ## total number of tests that will be run.
62 my ($db,$seq,$db2,$seq2,$seqio);
65 $seq = $seqio = undef;
67 #test redirection from GenBank and EMBL
70 ok $db = new Bio::DB::GenBank('-verbose'=>$verbose) ;
72 ok $db2 = new Bio::DB::EMBL('-verbose'=>$verbose) ;
75 $seq = $db->get_Seq_by_acc('NT_006732');
76 $seq2 = $db2->get_Seq_by_acc('NT_006732');
82 ok($seq = $db->get_Seq_by_acc('NM_006732'));
83 ok($seq && $seq->length eq 3775);
84 ok $seq2 = $db2->get_Seq_by_acc('NM_006732');
85 ok($seq2 && $seq2->length eq 3775);
90 print STDERR "Warning: Couldn't connect to RefSeq with Bio::DB::RefSeq.pm!\n" . $@;
100 ok defined($db = new Bio::DB::RefSeq(-verbose=>$verbose));
101 ok(defined($seq = $db->get_Seq_by_acc('NM_006732')));
102 ok( $seq->length, 3775);
103 ok defined ($db->request_format('fasta'));
104 ok(defined($seq = $db->get_Seq_by_acc('NM_006732')));
105 ok( $seq->length, 3775);
110 print STDERR "Warning: Couldn't connect to RefSeq with Bio::DB::RefSeq.pm!\n" . $@;