forked from lix-project/hydra
AttributeSet helper: skip wantarray
This commit is contained in:
parent
d2f03ca050
commit
30a7f068b7
|
@ -50,7 +50,7 @@ sub splitPath {
|
||||||
sub enumerate {
|
sub enumerate {
|
||||||
my ($self) = @_;
|
my ($self) = @_;
|
||||||
my @paths = sort { length($a) <=> length($b) } @{$self->{"paths"}};
|
my @paths = sort { length($a) <=> length($b) } @{$self->{"paths"}};
|
||||||
return wantarray ? @paths : \@paths;
|
return @paths;
|
||||||
}
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
|
@ -31,8 +31,9 @@ $attrs->registerValue("foo");
|
||||||
$attrs->registerValue("bar.baz.tux");
|
$attrs->registerValue("bar.baz.tux");
|
||||||
$attrs->registerValue("bar.baz.bux.foo.bar.baz");
|
$attrs->registerValue("bar.baz.bux.foo.bar.baz");
|
||||||
|
|
||||||
|
my @enumerated = $attrs->enumerate();
|
||||||
is(
|
is(
|
||||||
\@{$attrs->enumerate()},
|
\@enumerated,
|
||||||
[
|
[
|
||||||
# "foo": skipped since we're registering values, and we
|
# "foo": skipped since we're registering values, and we
|
||||||
# only want to track nested attribute sets.
|
# only want to track nested attribute sets.
|
||||||
|
|
Loading…
Reference in a new issue