Skip to content

Commit

Permalink
Squashed warning in DBFasta tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fangly committed Feb 26, 2012
1 parent a1f736f commit 54b138e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
8 changes: 4 additions & 4 deletions Bio/SeqIO/embl.pm
Expand Up @@ -505,11 +505,11 @@ sub _write_ID_line {

# The sequence name is supposed to be the primary accession number,
my $name = $seq->accession_number();
if (!defined($name) || $name eq 'unknown') {
# but if it is not present, use the sequence ID.
$name = $seq->id();
if ( not(defined $name) || $name eq 'unknown') {
# but if it is not present, use the sequence ID or the empty string
$name = $seq->id() || '';
}

$self->warn("No whitespace allowed in EMBL id [". $name. "]") if $name =~ /\s/;

# Use the sequence version, or default to 1.
Expand Down
5 changes: 2 additions & 3 deletions t/LocalDB/DBFasta.t
Expand Up @@ -4,10 +4,10 @@

BEGIN {
use lib '.';
use Bio::Root::Test;
use Bio::Root::Test;

test_begin(-tests => 23,
-requires_modules => [qw(Bio::DB::Fasta Bio::SeqIO)]);
-requires_modules => [qw(Bio::DB::Fasta Bio::SeqIO)]);
}
use strict;
use warnings;
Expand Down Expand Up @@ -51,7 +51,6 @@ my $out = Bio::SeqIO->new(-format => 'genbank',
-file => '>'.test_output_file());
$primary_seq = Bio::Seq->new(-primary_seq => $db->get_Seq_by_acc('AW057119'));
eval {
#warn(ref($primary_seq),"\n");
$out->write_seq($primary_seq)
};
ok(!$@);
Expand Down

0 comments on commit 54b138e

Please sign in to comment.