Skip to content

Commit

Permalink
fix Location tests to match API
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Fields committed Feb 26, 2012
1 parent 0d64c7f commit fb0ee84
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
6 changes: 0 additions & 6 deletions lib/Biome/Location/Simple.pm
Expand Up @@ -18,12 +18,6 @@ with 'Biome::Role::Location::Locatable';
sub BUILD {
my ($self, $params) = @_;

if ($params->{location_string}) {
$self->throw("Can't use 'location_string' with other parameters")
if (scalar(keys %$params) > 1);
$self->from_string($params->{location_string});
}

if ($params->{start} && $params->{end} && ($params->{end} < $params->{start})) {
$self->warn('End is greater than start; flipping strands');
$self->end($params->{start});
Expand Down
7 changes: 5 additions & 2 deletions t/Location/Simple.t
Expand Up @@ -281,9 +281,12 @@ is($container->end, 90);
$container->add_sub_Location($f);
is($container->num_sub_Locations(), 5);

$simple = Biome::Location::Simple->new(location_string => '10..20');
$simple = Biome::Location::Simple->new(start => 10,
end => 20);

$fuzzy = Biome::Location::Simple->new( location_string => '<10..20');
$fuzzy = Biome::Location::Simple->new( start => 10,
start_pos_type => '<',
end => 20);

$fuzzy->strand(-1);
is($fuzzy->to_string(), 'complement(<10..20)');
Expand Down

0 comments on commit fb0ee84

Please sign in to comment.