summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJeff <jdost@users.noreply.github.com>2020-02-01 04:49:11 -0800
committerGitHub <noreply@github.com>2020-02-01 13:49:11 +0100
commit83c2e467d5b34f9e74e2c55b1e9df2b715be175e (patch)
tree714ca7b869018ae516bdc5aefdc535aa0e84a630 /test
parenta422b33e9974e05ff9836a7ebcf1c938c20e4a37 (diff)
Add support for additional field on script entries `meta` (#1052)
* Add test for hidden meta data in script mode The purpose of this is to provide support for "hidden" fields on a script item that work for search but don't get displayed. This is mostly to provide something similar to the optional display (but still matchable) fields in drun like "categories" or "keywords". This also enables the choice to display unicode icons but still allow for searching for the keywords without needing to print them. * Ignore the output file from test runs * Add support for the "meta" field on script entries This fields provides a matchable but unprinted string for entries in a script mode list match. This means you can use one thing but provide multiple options that can match that item without polluting the list view or make confusing output. * Add new test to test suite file
Diffstat (limited to 'test')
-rwxr-xr-xtest/run_all_tests.sh1
-rwxr-xr-xtest/run_script_meta_test.sh26
-rwxr-xr-xtest/test_script.sh2
3 files changed, 28 insertions, 1 deletions
diff --git a/test/run_all_tests.sh b/test/run_all_tests.sh
index 94427e9f..8d619ab0 100755
--- a/test/run_all_tests.sh
+++ b/test/run_all_tests.sh
@@ -7,6 +7,7 @@ tests=(
run_dmenu_custom_test
run_run_test
run_script_test
+ run_script_meta_test
run_issue_256
run_issue_275
run_dmenu_empty
diff --git a/test/run_script_meta_test.sh b/test/run_script_meta_test.sh
new file mode 100755
index 00000000..cb570dae
--- /dev/null
+++ b/test/run_script_meta_test.sh
@@ -0,0 +1,26 @@
+#!/usr/bin/env bash
+
+SP=$(readlink -f "$0")
+DIR=$(dirname "$SP")
+echo "$DIR/test_script.sh"
+# wait till it is up, run rofi with error message
+sleep 1;
+rofi -modi "custom:$DIR/test_script.sh" -show custom &
+RPID=$!
+
+# send enter.
+sleep 5;
+xdotool key 'z'
+sleep 0.4
+xdotool key Return
+
+# Get result, kill xvfb
+wait ${RPID}
+RETV=$?
+OUTPUT=$( tr '\n' ' ' < output.txt )
+echo ${OUTPUT}
+if [ "${OUTPUT}" != 'mies ' ]
+then
+ exit 1
+fi
+exit ${RETV}
diff --git a/test/test_script.sh b/test/test_script.sh
index c4021380..4aab2db8 100755
--- a/test/test_script.sh
+++ b/test/test_script.sh
@@ -4,7 +4,7 @@ if [ -z "$1" ]
then
echo "aap"
echo "noot"
- echo "mies"
+ echo -ne "mies\0meta\x1fzoom\n"
else
echo $1 > output.txt
fi