Permalink
Browse files

Blat.t: Fixed skipped tests number and removed "$blat_present",

since test_skip() already check if the executable is available,
and executing it before test_skip() make the script crash if exe
is not present. Also removed some trailing whitespaces.
  • Loading branch information...
1 parent 27094fb commit a7b046042e58704f55e4ad6f77472a5e9826f457 @fjossandon fjossandon committed Dec 11, 2013
Showing with 15 additions and 18 deletions.
  1. +15 −18 t/Blat.t
View
33 t/Blat.t
@@ -3,10 +3,10 @@
use strict;
-BEGIN {
+BEGIN {
use Bio::Root::Test;
- test_begin(-tests => 40);
-
+ test_begin(-tests => 39);
+
use_ok 'Bio::Tools::Run::Alignment::Blat';
use_ok 'Bio::SeqIO';
use_ok 'Bio::Seq';
@@ -18,12 +18,10 @@ my $query = test_input_file('blat_dna.fa');
my $factory = Bio::Tools::Run::Alignment::Blat->new(-db => $db);
ok $factory->isa('Bio::Tools::Run::Alignment::Blat');
-my $blat_present = $factory->executable();
-
SKIP: {
test_skip(-requires_executable => $factory,
-tests => 24);
-
+
my $searchio = $factory->align($query);
isa_ok $searchio, 'Bio::SearchIO';
@@ -37,9 +35,9 @@ SKIP: {
is $hsp->hit->end, 1775;
is $hsp->hsp_length, 1775;
- my $sio = Bio::SeqIO->new(-file => $query, -format => 'fasta');
+ my $sio = Bio::SeqIO->new(-file => $query, -format => 'fasta');
my $seq = $sio->next_seq ;
-
+
$searchio = $factory->align($seq);
like $searchio, qr/psl/, 'PSL parser (default)';
$result = $searchio->next_result;
@@ -50,15 +48,15 @@ SKIP: {
is $hsp->query->end, 1775;
is $hsp->hit->start, 1;
is $hsp->hit->end, 1775;
-
+
# test alternate formats (not all of these work!)
$factory->reset_parameters(#-quiet => 1,
-db => $db,
-out => 'blast');
$searchio = $factory->align($query);
-
+
like $searchio, qr/blast/, 'BLAST parser';
-
+
$result = $searchio->next_result;
$hit = $result->next_hit;
$hsp = $hit->next_hsp;
@@ -67,14 +65,14 @@ SKIP: {
is $hsp->query->end, 1775;
is $hsp->hit->start, 1;
is $hsp->hit->end, 1775;
-
+
$factory->reset_parameters(#-quiet => 1,
-db => $db,
-out => 'blast9');
$searchio = $factory->align($query);
-
+
like $searchio, qr/blasttable/, 'Tabular BLAST parser';
-
+
$result = $searchio->next_result;
$hit = $result->next_hit;
$hsp = $hit->next_hsp;
@@ -113,11 +111,11 @@ SKIP: {
is $hsp->query->end, 100;
is $hsp->hit->start, 1;
is $hsp->hit->end, 100;
-
+
# No on-the-fly conversion of Bio::Seq yet
my $sio = Bio::SeqIO->new(-file=>$query,-format=>'fasta');
my $seq = $sio->next_seq ;
-
+
$searchio = $factory->align($seq);
$result = $searchio->next_result;
$hit = $result->next_hit;
@@ -129,5 +127,4 @@ SKIP: {
is $hsp->hit->end, 1775;
}
-1;
-
+1;

0 comments on commit a7b0460

Please sign in to comment.