diff options
-rwxr-xr-x | bin/hashl | 4 | ||||
-rw-r--r-- | lib/App/Hashl.pm | 2 | ||||
-rw-r--r-- | t/29-app-hashl.t | 2 |
3 files changed, 4 insertions, 4 deletions
@@ -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'); |