tests pass, find the right nodes more explicitly
[bioperl-run.git] / t / Primate.t
blobaca71d4106e519f8512f4722ca786143e7cbd0fb
1 ## Bioperl Test Harness Script for Modules
3 # Before `make install' is performed this script should be runnable with
4 # `make test'. After `make install' it should work as `perl test.t'
6 use strict;
7 use vars qw($NUMTESTS);
9 my $error;
11 BEGIN { 
12     # to handle systems with no installed Test module
13     # we include the t dir (where a copy of Test.pm is located)
14     # as a fallback
15     eval { require Test; };
16     $error = 0;
17     if( $@ ) {
18         use lib 't';
19     }
20     use Test;
22     $NUMTESTS = 6;
23     plan tests => $NUMTESTS;
26 if( $error ==  1 ) {
27     exit(0);
29 END { 
30     foreach ( $Test::ntest .. $NUMTESTS ) {
31         skip("unable to run all of the primate tests",1);
32     }
34 my $testnum;
35 my $verbose = 0;
37 ## End of black magic.
39 ## Insert additional test code below but remember to change
40 ## the print "1..x\n" in the BEGIN block to reflect the
41 ## total number of tests that will be run. 
43 use Bio::Tools::Run::Primate; 
45 use Bio::SeqIO;
47 my $query = "t/data/primate_query.fa";
48 my $target= "t/data/primate_target.fa";
50 my @params = ("query" => $query,"target" => $target,"m"=>0,"b"=>"TRUE");
51 my $fact = Bio::Tools::Run::Primate->new(@params);
52 unless ($fact->executable){
53   warn("Primate program not found. Skipping tests $Test::ntest to $NUMTESTS.\n");
54   exit(0);
57 ok($fact->isa("Bio::Tools::Run::Primate"));
58 my @feat = $fact->search;
60 ok ($feat[0]->isa("Bio::SeqFeature::Generic"));
62 ok ($feat[2]->start,11);
63 ok ($feat[5]->end,33);
64 ok ($feat[6]->seq->seq,"TATTTCTAC");
65 ok ($feat[12]->strand,-1);