diff options
| author | danix <danix@danix.xyz> | 2026-06-11 10:39:33 +0200 |
|---|---|---|
| committer | danix <danix@danix.xyz> | 2026-06-11 10:39:33 +0200 |
| commit | 363bc738f6fd20dae07faa5453f20477454f4428 (patch) | |
| tree | 60d0bc347bd64610e9ec2bfff03c614766039a72 /tests/wallp.bats | |
| parent | 97d910ef1ceb6bb27cb014f6df3ecd688936efe9 (diff) | |
| download | wallp-363bc738f6fd20dae07faa5453f20477454f4428.tar.gz wallp-363bc738f6fd20dae07faa5453f20477454f4428.zip | |
fix: qarma_select returns empty with plain --list
Use --radiolist --print-column=2 so the selected screen value is
actually printed. Plain --list printed nothing on selection, so the
qarma set flow exited without applying. Caught in hardware smoke test.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'tests/wallp.bats')
| -rw-r--r-- | tests/wallp.bats | 26 |
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 |
