From a146fdcd6fb2ad84625c29876c1fd1a780fbf0b3 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Wed, 18 May 2011 08:01:39 +0200 Subject: App/Hashl: files: Do not return sorted --- bin/hashl | 4 ++-- lib/App/Hashl.pm | 2 +- t/29-app-hashl.t | 2 +- 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'); -- cgit v1.2.3