Skip to content

Commit

Permalink
A test to ensure Bio::PrimarySeqI->trunc() doesn't use clone() for a …
Browse files Browse the repository at this point in the history
…Bio::Seq::RichSeq type object
  • Loading branch information
lairdm committed Mar 19, 2015
1 parent 6a5a45c commit ed9a303
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion t/Seq/Seq.t
Expand Up @@ -7,7 +7,7 @@ BEGIN {
use lib '.';
use Bio::Root::Test;

test_begin(-tests => 73);
test_begin(-tests => 76);

use_ok('Bio::Seq');
use_ok('Bio::Seq::RichSeq');
Expand Down Expand Up @@ -192,6 +192,15 @@ is ($richseq->keywords, 'JUNK1; JUNK2');
$richseq->seq_version('2');
is ($richseq->seq_version, 2);

# Test adding a feature to a RichSeq type, then
# trunc() and see if the feature vanishes (we shouldn't
# be using clone() for RichSeq types)
$richseq->add_SeqFeature($newfeat);
is $richseq->feature_count, 1;
my $newrichseq = $richseq->trunc(1,5);
is $newrichseq->feature_count, 0, "Don't use clone for trunc of Bio::Seq::RichSeq";
is $newrichseq->length, 5;

# tests for subtle misbehaviors
$seq = Bio::Seq->new(-primary_id => 'blah', -accession_number => 'foo');
is ($seq->accession_number, $seq->primary_seq->accession_number);
Expand Down

0 comments on commit ed9a303

Please sign in to comment.