From c9077797656d710d24b84d9a8523c4ffc8515b38 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Thu, 3 Feb 2011 20:36:39 +0100 Subject: Add tests for --action & --(un)loadable combo --- test/feh.t | 34 +++++++++++++++++++++++++++++++++- test/nx_action/loadable_action | 8 ++++++++ test/nx_action/loadable_naction | 8 ++++++++ test/nx_action/unloadable_action | 8 ++++++++ test/nx_action/unloadable_naction | 8 ++++++++ test/status | 4 ++-- 6 files changed, 67 insertions(+), 3 deletions(-) create mode 100644 test/nx_action/loadable_action create mode 100644 test/nx_action/loadable_naction create mode 100644 test/nx_action/unloadable_action create mode 100644 test/nx_action/unloadable_naction diff --git a/test/feh.t b/test/feh.t index b08238b..c868382 100644 --- a/test/feh.t +++ b/test/feh.t @@ -2,7 +2,7 @@ use strict; use warnings; use 5.010; -use Test::Command tests => 48; +use Test::Command tests => 60; $ENV{HOME} = 'test'; @@ -61,6 +61,38 @@ $cmd->exit_is_num(0); $cmd->stdout_like($re_loadable); $cmd->stderr_is_eq(''); +$cmd = Test::Command->new( + cmd => "$feh --loadable --action 'echo touch %f' $images" +); + +$cmd->exit_is_num(0); +$cmd->stdout_is_file('test/nx_action/loadable_action'); +$cmd->stderr_is_eq(''); + +$cmd = Test::Command->new( + cmd => "$feh --loadable --action ';echo touch %f' $images" +); + +$cmd->exit_is_num(0); +$cmd->stdout_is_file('test/nx_action/loadable_naction'); +$cmd->stderr_is_eq(''); + +$cmd = Test::Command->new( + cmd => "$feh --unloadable --action 'echo rm %f' $images" +); + +$cmd->exit_is_num(0); +$cmd->stdout_is_file('test/nx_action/unloadable_action'); +$cmd->stderr_is_eq(''); + +$cmd = Test::Command->new( + cmd => "$feh --unloadable --action ';echo rm %f' $images" +); + +$cmd->exit_is_num(0); +$cmd->stdout_is_file('test/nx_action/unloadable_naction'); +$cmd->stderr_is_eq(''); + $cmd = Test::Command->new(cmd => "$feh --unloadable $images"); $cmd->exit_is_num(0); diff --git a/test/nx_action/loadable_action b/test/nx_action/loadable_action new file mode 100644 index 0000000..d173261 --- /dev/null +++ b/test/nx_action/loadable_action @@ -0,0 +1,8 @@ +touch test/ok/gif +touch test/ok/jpg +touch test/ok/png +touch test/ok/pnm +test/ok/gif +test/ok/jpg +test/ok/png +test/ok/pnm diff --git a/test/nx_action/loadable_naction b/test/nx_action/loadable_naction new file mode 100644 index 0000000..d173261 --- /dev/null +++ b/test/nx_action/loadable_naction @@ -0,0 +1,8 @@ +touch test/ok/gif +touch test/ok/jpg +touch test/ok/png +touch test/ok/pnm +test/ok/gif +test/ok/jpg +test/ok/png +test/ok/pnm diff --git a/test/nx_action/unloadable_action b/test/nx_action/unloadable_action new file mode 100644 index 0000000..c16572e --- /dev/null +++ b/test/nx_action/unloadable_action @@ -0,0 +1,8 @@ +rm test/fail/gif +rm test/fail/jpg +rm test/fail/png +rm test/fail/pnm +test/fail/gif +test/fail/jpg +test/fail/png +test/fail/pnm diff --git a/test/nx_action/unloadable_naction b/test/nx_action/unloadable_naction new file mode 100644 index 0000000..c16572e --- /dev/null +++ b/test/nx_action/unloadable_naction @@ -0,0 +1,8 @@ +rm test/fail/gif +rm test/fail/jpg +rm test/fail/png +rm test/fail/pnm +test/fail/gif +test/fail/jpg +test/fail/png +test/fail/pnm diff --git a/test/status b/test/status index aa66672..9d57aaf 100644 --- a/test/status +++ b/test/status @@ -19,8 +19,8 @@ Overall test status, what's covered / missing [x] hold-action flag [x] supports format specifiers [x] with --list - [ ] with --loadable - [ ] with --unloadable + [x] with --loadable + [x] with --unloadable --alpha --auto-zoom -- cgit v1.2.3