Tests for getParent and getParentLineage

Fixed getParentLineage.  The regular expression only matched strings
that were 8 characters long.
This commit is contained in:
Colin Kuskie 2007-04-13 21:45:32 +00:00
parent a548341aea
commit e894ed29ae
2 changed files with 27 additions and 2 deletions

View file

@ -540,7 +540,9 @@ Optional lineage of another Asset.
sub getParentLineage {
my $self = shift;
my $lineage = shift || $self->get("lineage");
my ($parentLineage) = $lineage =~ m/^(.).{6}$/;
my $lineageLength = length($lineage) - 6;
return $lineage unless $lineageLength;
my $parentLineage = substr($lineage, 0, $lineageLength);
return $parentLineage;
}