summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2011-05-18 08:01:39 +0200
committerDaniel Friesel <derf@finalrewind.org>2011-05-18 08:01:39 +0200
commita146fdcd6fb2ad84625c29876c1fd1a780fbf0b3 (patch)
tree49ca622e96e1d2d588314c29540eb9bb2d13c563
parent556ea57a7ce1e072f5360c00f5cef2406dff794f (diff)
App/Hashl: files: Do not return sorted
-rwxr-xr-xbin/hashl4
-rw-r--r--lib/App/Hashl.pm2
-rw-r--r--t/29-app-hashl.t2
3 files changed, 4 insertions, 4 deletions
diff --git a/bin/hashl b/bin/hashl
index 3948821..30b3993 100755
--- a/bin/hashl
+++ b/bin/hashl
@@ -303,7 +303,7 @@ sub cmd_list {
$hashl->read_size(),
$hashl->si_size($hashl->read_size()),
);
- for my $name ($hashl->files()) {
+ for my $name (sort $hashl->files()) {
my $file = $hashl->file($name);
printf(
"%s %-7s %s\n",
@@ -315,7 +315,7 @@ sub cmd_list {
}
sub cmd_list_files {
- say join("\n", $hashl->files());
+ say join("\n", sort $hashl->files());
}
sub cmd_list_ignored {
diff --git a/lib/App/Hashl.pm b/lib/App/Hashl.pm
index f95653a..0e08794 100644
--- a/lib/App/Hashl.pm
+++ b/lib/App/Hashl.pm
@@ -202,7 +202,7 @@ Returns a list of all file names in the database
sub files {
my ($self) = @_;
- return sort keys %{ $self->{files} };
+ return keys %{ $self->{files} };
}
=item $hashl->add_file(I<%data>)
diff --git a/t/29-app-hashl.t b/t/29-app-hashl.t
index c14aca1..325c3b2 100644
--- a/t/29-app-hashl.t
+++ b/t/29-app-hashl.t
@@ -54,7 +54,7 @@ ok($hashl->add_file(
),
'Add another file'
);
-is_deeply([$hashl->files()], [qw[t/in/1k t/in/4]], 'Both files in list');
+is_deeply([sort $hashl->files()], [qw[t/in/1k t/in/4]], 'Both files in list');
ok($hashl->file_in_db('t/in/1k'), 'file in db');
ok($hashl->file_in_db('t/in/4'), 'other file in db');