New INSTALL.WIN doc (from wiki)
[bioperl-live.git] / t / SimilarityPair.t
blob1ef6190e059909d23ec72e79ea0f6446699cc2c8
1 # -*-Perl-*-
2 ## Bioperl Test Harness Script for Modules
3 ##
4 # CVS Version
5 # $Id$
8 # Before `make install' is performed this script should be runnable with
9 # `make test'. After `make install' it should work as `perl test.t'
11 use strict;
13 BEGIN {     
14     # to handle systems with no installed Test module
15     # we include the t dir (where a copy of Test.pm is located)
16     # as a fallback
17     eval { require Test; };
18     if( $@ ) {
19         use lib 't';
20     }
21     use Test;
23     plan tests => 5;
25 use Bio::Seq;
26 use Bio::SeqFeature::SimilarityPair;
27 use Bio::SearchIO;
28 use Bio::SeqIO;
29 use Bio::Root::IO;
31 # test SimilarityPair
33 my $seq = (new Bio::SeqIO('-format' => 'fasta',
34                           '-file' => Bio::Root::IO->catfile("t","data","AAC12660.fa")))->next_seq();
35 ok defined( $seq) && $seq->isa('Bio::SeqI');
36 my $blast = new Bio::SearchIO('-file'=>Bio::Root::IO->catfile("t","data","blast.report"), '-format' => 'blast');
37 ok defined ($blast) && $blast->isa('Bio::SearchIO');
38 my $r = $blast->next_result;
39 my $hit = $r->next_hit;
40 ok defined ($hit) && $hit->isa('Bio::Search::Hit::HitI'), 1, ' hit is ' . ref($hit);
41 my $sim_pair = $hit->next_hsp;
42 ok defined($sim_pair) && $sim_pair->isa('Bio::SeqFeatureI');
43 $seq->add_SeqFeature($sim_pair);
44 ok $seq->all_SeqFeatures() == 1;