Add fuzzy test.

This commit is contained in:
Dave Davenport 2016-01-04 18:04:15 +01:00
parent d661a515f0
commit dac711cf22
2 changed files with 25 additions and 1 deletions

View file

@ -200,8 +200,10 @@ test-x: ${bin_PROGRAMS}
$(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 "Test dmenu fuzzy"
$(top_srcdir)/test/run_test.sh 217 $(top_srcdir)/test/run_fuzzy_test.sh $(top_builddir)
echo "Test config dump"
$(top_srcdir)/test/run_test.sh 217 $(top_srcdir)/test/xr_config_test.sh $(top_builddir) $(top_srcdir)
$(top_srcdir)/test/run_test.sh 218 $(top_srcdir)/test/xr_config_test.sh $(top_builddir) $(top_srcdir)
echo "End tests"

22
test/run_fuzzy_test.sh Executable file
View file

@ -0,0 +1,22 @@
#!/usr/bin/env bash
echo -en "nooty\naap\nnoot\nmies" | rofi -fuzzy -dmenu > output.txt &
RPID=$!
# send enter.
sleep 5;
xdotool type 'nty'
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}