From 45e07bb83ccaf0bb822bf67d04219eb2559c65b7 Mon Sep 17 00:00:00 2001 From: Dave Davenport Date: Sun, 31 Aug 2014 09:28:55 +0200 Subject: [PATCH] [dmenu] Update tests to hit the shift-enter mode --- test/run_dmenu_custom_test.sh | 6 ++++-- test/run_dmenu_test.sh | 7 +++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/test/run_dmenu_custom_test.sh b/test/run_dmenu_custom_test.sh index 039d5ab8..43000f1b 100755 --- a/test/run_dmenu_custom_test.sh +++ b/test/run_dmenu_custom_test.sh @@ -1,5 +1,6 @@ #!/usr/bin/env bash +xrdb -load ../doc/example.xresources echo -e -n "aap\nnoot\nmies" | rofi -width -30 -dmenu > output.txt & RPID=$! @@ -17,13 +18,14 @@ xdotool key 'e' sleep 0.2 xdotool key 'e' sleep 0.2 +xdotool key Shift+Return xdotool key Return # Get result, kill xvfb wait ${RPID} RETV=$? - -if [ `cat output.txt` != 'coffee' ] +OUTPUT=$(cat output.txt | tr '\n' ' ') +if [ "${OUTPUT}" != 'coffee coffee ' ] then exit 1 fi diff --git a/test/run_dmenu_test.sh b/test/run_dmenu_test.sh index 3cedd65e..d02e538b 100755 --- a/test/run_dmenu_test.sh +++ b/test/run_dmenu_test.sh @@ -9,15 +9,14 @@ RPID=$! sleep 5; xdotool key 'Down' sleep 0.4 -xdotool key 'Down' -sleep 0.4 +xdotool key Shift+Return xdotool key Return # Get result, kill xvfb wait ${RPID} RETV=$? - -if [ `cat output.txt` != 'mies' ] +OUTPUT=$(cat output.txt | tr '\n' ' ') +if [ "${OUTPUT}" != 'noot mies ' ] then exit 1 fi