1 # -*-Perl-*- Test Harness script for Bioperl
10 test_begin(-tests => 26,
11 -requires_module => 'IO::String');
14 use_ok('Bio::SearchIO');
15 use_ok('Bio::Index::Blast');
18 END { unlink qw( Wibbl Wibbl.pag Wibbl.dir Wibbl.index); }
22 my $index = Bio::Index::Blast->new(-filename => 'Wibbl',
26 $index->make_index(test_input_file('multi_blast.bls'));
27 ($index->dbm_package eq 'SDBM_File') ?
28 (ok(-e "Wibbl.pag" && -e "Wibbl.dir")) :
31 foreach my $id ( qw(CATH_RAT PAPA_CARPA) ) {
32 my $fh = $index->get_stream($id);
35 my $report = Bio::SearchIO->new(-noclose => 1,
38 my $result = $report->next_result;
39 like($result->query_name, qr/$id/);
40 ok( $result->next_hit);
42 like( $index->fetch_report($id)->query_name, qr/$id/);
47 $index = Bio::Index::Blast->new(-filename => 'Wibbl.index',
51 $index->make_index(test_input_file('rpsblast.bls'));
53 foreach my $id ( qw(orf20 orf40) ) {
54 my $fh = $index->get_stream($id);
57 my $report = Bio::SearchIO->new(-noclose => 1,
60 my $result = $report->next_result;
61 like($result->query_name, qr/$id/);
62 ok( $result->next_hit);
64 like( $index->fetch_report($id)->query_name, qr/$id/);