summaryrefslogtreecommitdiff
path: root/test/feh.i
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2011-01-25 19:34:48 +0100
committerDaniel Friesel <derf@finalrewind.org>2011-01-25 19:34:48 +0100
commit4f2f93e894f2772880881709dc9d5e033a6d0fa8 (patch)
treeb84e9f4860968c1013708860e509dcdd13c81275 /test/feh.i
parent6166ca288a6217311887adeaf233da1d22c600bd (diff)
downloadfeh-4f2f93e894f2772880881709dc9d5e033a6d0fa8.zip
Add tests for keys config
Diffstat (limited to 'test/feh.i')
-rwxr-xr-xtest/feh.i49
1 files changed, 48 insertions, 1 deletions
diff --git a/test/feh.i b/test/feh.i
index d1a2d66..a19d5cd 100755
--- a/test/feh.i
+++ b/test/feh.i
@@ -4,7 +4,7 @@ use warnings;
use 5.010;
use Cwd;
-use Test::More tests => 82;
+use Test::More tests => 97;
use Time::HiRes qw/sleep/;
use X11::GUITest qw/:ALL/;
@@ -205,6 +205,53 @@ ok(waitfor { not -e 'feh_test_2_3' }, 'feh action removed file');
test_win_title($win, 'feh [3 of 3] - test/ok/jpg');
feh_stop();
+
+# .config/feh/keys
+# Action Unbinding + non-conflicting none/shift/control/meta modifiers
+
+$ENV{XDG_CONFIG_HOME} = 'test/config';
+$win = feh_start(
+ '--action1 "touch a1" --action2 "touch a2" ' .
+ '--action3 "touch a3" --action4 "touch a4" ' .
+ '--action5 "touch a5" --action6 "touch a6" ',
+ 'test/ok/png test/ok/jpg test/ok/pnm'
+);
+test_win_title($win, 'feh [1 of 3] - test/ok/png');
+SendKeys('6');
+test_win_title($win, 'feh [1 of 3] - test/ok/png');
+SendKeys('{RIG}');
+test_win_title($win, 'feh [1 of 3] - test/ok/png');
+SendKeys('a');
+test_win_title($win, 'feh [2 of 3] - test/ok/jpg');
+SendKeys('b');
+test_win_title($win, 'feh [3 of 3] - test/ok/pnm');
+SendKeys('c');
+test_win_title($win, 'feh [1 of 3] - test/ok/png');
+SendKeys('d');
+test_win_title($win, 'feh [3 of 3] - test/ok/pnm');
+SendKeys('e');
+test_win_title($win, 'feh [2 of 3] - test/ok/jpg');
+SendKeys('f');
+test_win_title($win, 'feh [1 of 3] - test/ok/png');
+SendKeys('1');
+test_win_title($win, 'feh [1 of 3] - test/ok/png');
+SendKeys('x');
+ok(waitfor { -e 'a1' }, 'action 1 = X ok');
+SendKeys('X');
+ok(waitfor { -e 'a2' }, 'action 2 = Shift+X ok');
+SendKeys('^(x)');
+ok(waitfor { -e 'a3' }, 'action 3 = Ctrl+X ok');
+SendKeys('^(X)');
+ok(waitfor { -e 'a4' }, 'action 4 = Ctrl+Shift+X ok');
+SendKeys('%(x)');
+ok(waitfor { -e 'a5' }, 'action 5 = Alt+X ok');
+delete $ENV{XDG_CONFIG_HOME};
+for my $f (qw(a1 a2 a3 a4 a5)) {
+ unlink($f);
+}
+feh_stop();
+
+
$win = feh_start(q{}, 'test/ok/png ' x 100);
test_win_title($win, 'feh [1 of 100] - test/ok/png');
SendKeys('{PGD}');