32
|
0 |
25 |
0 |
$test_name //= do {
my $name = "\$archive->$method";
if (@$arguments) {
my $first = 1;
$name .= '(';
foreach my $arg (@$arguments) {
$name .= ', ' unless $first;
$first = 0;
my $ref = ref $arg;
if ($ref eq '') {
if (length $arg > 34) {
$name .= "'@{[substr($arg, 0, 30) =~ s/\n/\\n/gru];}...'";
}
else {
$name .= "'@{[$arg =~ s/\n/\\n/gru];}'";
};
}
elsif ($ref eq 'HASH') {
$name .= '{...}';
}
elsif ($ref eq 'ARRAY') {
$name .= '[...]';
}
elsif ($ref eq 'CODE') {
$name .= 'sub {...}';
};
};
$name .= ')';
};
$name .= " == ARCHIVE_@{[uc $code];}";
$name
} |