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');
20 my $index = Bio::Index::Blast->new(-filename => 'Wibbl',
24 $index->make_index(test_input_file('multi_blast.bls'));
25 ($index->dbm_package eq 'SDBM_File') ?
26 (ok(-e "Wibbl.pag" && -e "Wibbl.dir")) :
29 foreach my $id ( qw(CATH_RAT PAPA_CARPA) ) {
30 my $fh = $index->get_stream($id);
33 my $report = Bio::SearchIO->new(-noclose => 1,
36 my $result = $report->next_result;
37 like($result->query_name, qr/$id/);
38 ok( $result->next_hit);
40 like( $index->fetch_report($id)->query_name, qr/$id/);
42 # ActivePerl will not allow deletion if the tie-hash is still active
44 unlink qw( Wibbl Wibbl.pag Wibbl.dir );
48 $index = Bio::Index::Blast->new(-filename => 'Wibbl.index',
52 $index->make_index(test_input_file('rpsblast.bls'));
54 foreach my $id ( qw(orf20 orf40) ) {
55 my $fh = $index->get_stream($id);
58 my $report = Bio::SearchIO->new(-noclose => 1,
61 my $result = $report->next_result;
62 like($result->query_name, qr/$id/);
63 ok( $result->next_hit);
65 like( $index->fetch_report($id)->query_name, qr/$id/);
67 # ActivePerl will not allow deletion if the tie-hash is still active
69 unlink qw( Wibbl.index Wibbl.index.pag Wibbl.index.dir );