aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/wallp.bats26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/wallp.bats b/tests/wallp.bats
index d7edaec..e809c13 100644
--- a/tests/wallp.bats
+++ b/tests/wallp.bats
@@ -238,6 +238,32 @@ teardown() {
[[ "$output" == *"no display"* ]]
}
+@test "set qarma path applies selected screen" {
+ CONF_OUTPUT_H="DP-1"; CONF_OUTPUT_V="DP-3"; CONF_THEME="conf"
+ export WAYLAND_DISPLAY="wayland-0"
+ : > "$HOME/picked.png"
+ # qarma stub: --list returns the screen choice; --file-selection returns a path.
+ # Real qarma --list returns the chosen row only with --radiolist and
+ # --print-column=2; a plain --list prints nothing. The stub mirrors that, so
+ # this test fails unless qarma_select uses the correct flags.
+ cat > "$STUB_DIR/qarma" <<EOF
+#!/bin/bash
+echo "qarma \$*" >> "$TMP_HOME/calls.log"
+case "\$*" in
+ *--list*)
+ case "\$*" in
+ *--radiolist*--print-column=2*|*--print-column=2*--radiolist*) echo "V" ;;
+ esac ;;
+ *--file-selection*) echo "$HOME/picked.png" ;;
+esac
+exit 0
+EOF
+ chmod +x "$STUB_DIR/qarma"
+ do_set ""
+ grep -q "swaybg -o DP-3 -i $HOME/picked.png" "$HOME/calls.log"
+ ! grep -q "swaybg -o DP-1" "$HOME/calls.log"
+}
+
@test "bare invocation shows help" {
unset WAYLAND_DISPLAY
run main