summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2012-10-13 16:26:53 +0200
committerDaniel Friesel <derf@finalrewind.org>2012-10-13 16:26:53 +0200
commit906ec657cdd958b25a6833f644a57bcf08c3a38b (patch)
treea35c4fb6e9374399e8e60ffeae2fa7d294b56ca7 /test
parent8caf865bf7468e335559218305a202425fa99162 (diff)
Add --min-dimension and --max-dimension options (closes #101)
Diffstat (limited to 'test')
-rw-r--r--test/feh.t31
-rw-r--r--test/no-loadable-files2
2 files changed, 30 insertions, 3 deletions
diff --git a/test/feh.t b/test/feh.t
index 1d5576b..8f415f3 100644
--- a/test/feh.t
+++ b/test/feh.t
@@ -2,13 +2,14 @@
use strict;
use warnings;
use 5.010;
-use Test::Command tests => 59;
+use Test::Command tests => 71;
$ENV{HOME} = 'test';
my $feh = "src/feh";
-my $images = 'test/ok/gif test/ok/jpg test/ok/png test/ok/pnm '
- . 'test/fail/gif test/fail/jpg test/fail/png test/fail/pnm';
+my $images_ok = 'test/ok/gif test/ok/jpg test/ok/png test/ok/pnm';
+my $images_fail = 'test/fail/gif test/fail/jpg test/fail/png test/fail/pnm';
+my $images = "${images_ok} ${images_fail}";
my $feh_name = $ENV{'PACKAGE'};
@@ -133,3 +134,27 @@ $cmd = Test::Command->new(cmd =>
$cmd->exit_is_num(0);
$cmd->stdout_is_file('test/list/default');
$cmd->stderr_like($re_list_action);
+
+$cmd = Test::Command->new(cmd => "$feh --list --min-dimension 20x20 $images_ok");
+
+$cmd->exit_is_num(1);
+$cmd->stdout_is_eq('');
+$cmd->stderr_is_file('test/no-loadable-files');
+
+$cmd = Test::Command->new(cmd => "$feh --list --max-dimension 10x10 $images_ok");
+
+$cmd->exit_is_num(1);
+$cmd->stdout_is_eq('');
+$cmd->stderr_is_file('test/no-loadable-files');
+
+$cmd = Test::Command->new(cmd => "$feh --list --min-dimension 16x16 $images_ok");
+
+$cmd->exit_is_num(0);
+$cmd->stdout_is_file('test/list/default');
+$cmd->stderr_is_eq('');
+
+$cmd = Test::Command->new(cmd => "$feh --list --max-dimension 16x16 $images_ok");
+
+$cmd->exit_is_num(0);
+$cmd->stdout_is_file('test/list/default');
+$cmd->stderr_is_eq('');
diff --git a/test/no-loadable-files b/test/no-loadable-files
new file mode 100644
index 0000000..bc5871d
--- /dev/null
+++ b/test/no-loadable-files
@@ -0,0 +1,2 @@
+feh: No loadable images specified.
+See 'man feh' for detailed usage information