Change the output delimiter from space to comma
parent
b3ad72ad6a
commit
2856e26141
|
@ -38,7 +38,7 @@ handle remainder => sub {
|
|||
@numbers = @numbers[0..MAX_LIST_SIZE - 1];
|
||||
}
|
||||
my @sorted = sort { $ascending ? $a <=> $b : $b <=> $a } @numbers;
|
||||
my $list = join(' ', @sorted);
|
||||
my $list = join(', ', @sorted);
|
||||
return sprintf("$list (Sorted %s)", $ascending ? 'ascendingly' : 'descendingly');
|
||||
}
|
||||
return;
|
||||
|
|
|
@ -12,8 +12,8 @@ ddg_goodie_test(
|
|||
[qw(
|
||||
DDG::Goodie::Sort
|
||||
)],
|
||||
'sort -1, +4, -3, 5.7' => test_zci('-3 -1 +4 5.7 (Sorted ascendingly)'),
|
||||
'sort desc -4.4 .5 1 66 15 -55' => test_zci('66 15 1 .5 -4.4 -55 (Sorted descendingly)'),
|
||||
'sort -1, +4, -3, 5.7' => test_zci('-3, -1, +4, 5.7 (Sorted ascendingly)'),
|
||||
'sort desc -4.4 .5 1 66 15 -55' => test_zci('66, 15, 1, .5, -4.4, -55 (Sorted descendingly)'),
|
||||
);
|
||||
|
||||
done_testing;
|
||||
|
|
Loading…
Reference in New Issue