Skip to content

Commit

Permalink
Bio::Tools::CodonTable: enable selection of table id=0 on constructor (
Browse files Browse the repository at this point in the history
  • Loading branch information
Juke34 authored and carandraug committed Apr 26, 2024
1 parent cfc66e5 commit 62ee9df
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/Bio/Tools/CodonTable.pm
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ sub new {
@args);

$id = 1 if ( ! defined ( $id ) );
$id && $self->id($id);
$self->id($id);
return $self; # success - we hope!
}

Expand Down
6 changes: 5 additions & 1 deletion t/SeqTools/CodonTable.t
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use strict;
BEGIN {
use Bio::Root::Test;

test_begin(-tests => 86);
test_begin(-tests => 87);

use_ok('Bio::Tools::CodonTable');
use_ok('Bio::CodonUsage::IO');
Expand All @@ -18,6 +18,10 @@ my $myCodonTable = Bio::Tools::CodonTable -> new ( -id => 16);
ok defined $myCodonTable;
isa_ok $myCodonTable, 'Bio::Tools::CodonTable';

# Access to ID table 0 through constructor
$myCodonTable = Bio::Tools::CodonTable->new( -id => 0);
is $myCodonTable->id(), 0;

# defaults to ID 1 "Standard"
$myCodonTable = Bio::Tools::CodonTable->new();
is $myCodonTable->id(), 1;
Expand Down

0 comments on commit 62ee9df

Please sign in to comment.