mirror of
https://github.com/davatorium/rofi.git
synced 2024-11-11 13:50:48 -05:00
Test glob/regex.
This commit is contained in:
parent
5a3c202423
commit
4fbbce891b
3 changed files with 62 additions and 0 deletions
|
@ -196,6 +196,10 @@ test-x: ${bin_PROGRAMS}
|
|||
$(top_srcdir)/test/run_test.sh 213 $(top_srcdir)/test/run_drun_test.sh $(top_builddir)
|
||||
echo "Test combi"
|
||||
$(top_srcdir)/test/run_test.sh 214 $(top_srcdir)/test/run_combi_test.sh $(top_builddir)
|
||||
echo "Test dmenu regex"
|
||||
$(top_srcdir)/test/run_test.sh 215 $(top_srcdir)/test/run_regex_test.sh $(top_builddir)
|
||||
echo "Test dmenu glob"
|
||||
$(top_srcdir)/test/run_test.sh 216 $(top_srcdir)/test/run_glob_test.sh $(top_builddir)
|
||||
echo "End tests"
|
||||
|
||||
|
||||
|
|
26
test/run_glob_test.sh
Executable file
26
test/run_glob_test.sh
Executable file
|
@ -0,0 +1,26 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
echo -en "nooty\naap\nnoot\nmies" | rofi -glob -dmenu > output.txt &
|
||||
RPID=$!
|
||||
|
||||
# send enter.
|
||||
sleep 5;
|
||||
xdotool key 'n'
|
||||
sleep 0.4
|
||||
xdotool key Shift+'8'
|
||||
sleep 0.4
|
||||
xdotool key 't'
|
||||
sleep 0.4
|
||||
xdotool key Return
|
||||
|
||||
# Get result, kill xvfb
|
||||
wait ${RPID}
|
||||
RETV=$?
|
||||
OUTPUT=$(cat output.txt)
|
||||
if [ "${OUTPUT}" != 'nooty' ]
|
||||
then
|
||||
echo "Got: '${OUTPUT}' expected 'nooty'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
exit ${RETV}
|
32
test/run_regex_test.sh
Executable file
32
test/run_regex_test.sh
Executable file
|
@ -0,0 +1,32 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
echo -en "nooty\naap\nnoot\nmies" | rofi -regex -dmenu > output.txt &
|
||||
RPID=$!
|
||||
|
||||
# send enter.
|
||||
sleep 5;
|
||||
xdotool key Shift+'6'
|
||||
sleep 0.4
|
||||
xdotool key 'n'
|
||||
sleep 0.4
|
||||
xdotool key 'o'
|
||||
sleep 0.4
|
||||
xdotool key 'o'
|
||||
sleep 0.4
|
||||
xdotool key 't'
|
||||
sleep 0.4
|
||||
xdotool key Shift+'4'
|
||||
sleep 0.4
|
||||
xdotool key Return
|
||||
|
||||
# Get result, kill xvfb
|
||||
wait ${RPID}
|
||||
RETV=$?
|
||||
OUTPUT=$(cat output.txt)
|
||||
if [ "${OUTPUT}" != 'noot' ]
|
||||
then
|
||||
echo "Got: '${OUTPUT}' expected 'noot'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
exit ${RETV}
|
Loading…
Reference in a new issue