diff options
author | Daniel Friesel <derf@derf.homelinux.org> | 2010-05-05 19:27:34 +0200 |
---|---|---|
committer | Daniel Friesel <derf@derf.homelinux.org> | 2010-05-05 19:27:34 +0200 |
commit | 721079d0acfc96492bd3bbf8d62f484117948b54 (patch) | |
tree | a7ac4e3e8e0d2e8acc6919876b9193d2f66f9056 /test/test.pl | |
parent | 1cffd68005a6cfce7a069453f4d9142a712c6af1 (diff) |
Add some more tests
Diffstat (limited to 'test/test.pl')
-rw-r--r-- | test/test.pl | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/test/test.pl b/test/test.pl index 69ba824..4b18ccc 100644 --- a/test/test.pl +++ b/test/test.pl @@ -2,7 +2,7 @@ use strict; use warnings; use 5.010; -use Test::Command tests => 18; +use Test::Command tests => 48; my $feh = 'src/feh'; my $images = 'test/ok.* test/fail.*'; @@ -13,6 +13,7 @@ my $re_warning = qr{${feh_name} WARNING: test/fail\.... \- No Imlib2 loader for that file format\n}; my $re_loadable = qr{test/ok\....}; my $re_unloadable = qr{test/fail\....}; +my $re_list_action = qr{test/ok\.... 16x16 \(${feh_name}\)}; my $cmd = Test::Command->new(cmd => $feh); @@ -24,29 +25,59 @@ ${feh_name} - No loadable images specified. Use ${feh_name} --help for detailed usage information EOF -# feh --version / feh -v $cmd = Test::Command->new(cmd => "$feh --version"); + $cmd->exit_is_num(0); $cmd->stdout_is_eq("${feh_name} version ${feh_version}\n"); $cmd->stderr_is_eq(''); $cmd = Test::Command->new(cmd => "$feh --loadable $images"); + $cmd->exit_is_num(0); $cmd->stdout_like($re_loadable); $cmd->stderr_is_eq(''); $cmd = Test::Command->new(cmd => "$feh --unloadable $images"); + $cmd->exit_is_num(0); $cmd->stdout_like($re_unloadable); $cmd->stderr_is_eq(''); $cmd = Test::Command->new(cmd => "$feh --list $images"); + $cmd->exit_is_num(0); $cmd->stdout_is_file('test/list'); $cmd->stderr_like($re_warning); +for my $sort (qw/name filename width height pixels size format/) { + $cmd = Test::Command->new(cmd => "$feh --list $images --sort $sort"); + + $cmd->exit_is_num(0); + $cmd->stdout_is_file("test/list_$sort"); + $cmd->stderr_like($re_warning); +} + +$cmd = Test::Command->new(cmd => "$feh --list $images --sort format --reverse"); + +$cmd->exit_is_num(0); +$cmd->stdout_is_file('test/list_format_reverse'); +$cmd->stderr_like($re_warning); + $cmd = Test::Command->new(cmd => "$feh --customlist '%f; %h; %l; %m; %n; %p; " . "%s; %t; %u; %w' $images"); + $cmd->exit_is_num(0); $cmd->stdout_is_file('test/customlist'); $cmd->stderr_like($re_warning); + +$cmd = Test::Command->new(cmd => "$feh --list --quiet $images"); +$cmd->exit_is_num(0); +$cmd->stdout_is_file('test/list'); +$cmd->stderr_is_eq(''); + +$cmd = Test::Command->new(cmd => + "$feh --quiet --list --action 'echo \"%f %wx%h (%P)\" >&2' $images"); + +$cmd->exit_is_num(0); +$cmd->stdout_is_file('test/list'); +$cmd->stderr_like($re_list_action); |