aboutsummaryrefslogtreecommitdiffstats
path: root/tests/wallp.bats
diff options
context:
space:
mode:
authordanix <danix@danix.xyz>2026-06-11 10:10:16 +0200
committerdanix <danix@danix.xyz>2026-06-11 10:10:16 +0200
commit2f6f5e0920efd60150bbd7c93cefce7281d68c78 (patch)
tree2a1b65dbdcd838847eb9480290feb6d989fe38ab /tests/wallp.bats
parent17920afbe5ab2c1ba3e81c9a38a0c924ccd9d1a0 (diff)
downloadwallp-2f6f5e0920efd60150bbd7c93cefce7281d68c78.tar.gz
wallp-2f6f5e0920efd60150bbd7c93cefce7281d68c78.zip
feat: help screen + main dispatch
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'tests/wallp.bats')
-rw-r--r--tests/wallp.bats30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/wallp.bats b/tests/wallp.bats
index ad4b9bf..0d6fc7e 100644
--- a/tests/wallp.bats
+++ b/tests/wallp.bats
@@ -237,3 +237,33 @@ teardown() {
[ "$status" -eq 1 ]
[[ "$output" == *"no display"* ]]
}
+
+@test "bare invocation shows help" {
+ unset WAYLAND_DISPLAY
+ run main
+ [ "$status" -eq 0 ]
+ [[ "$output" == *"Usage"* ]]
+}
+
+@test "unknown flag errors with help" {
+ unset WAYLAND_DISPLAY
+ run main --bogus
+ [ "$status" -eq 1 ]
+ [[ "$output" == *"Usage"* ]]
+}
+
+@test "bootstrap on missing conf exits zero without setting wallpaper" {
+ unset WAYLAND_DISPLAY
+ run main --restore
+ [ "$status" -eq 0 ]
+ [ ! -e "$HOME/.cache/wallp/H.pid" ]
+}
+
+@test "theme flag honored through main with restore" {
+ unset WAYLAND_DISPLAY
+ mkdir -p "$HOME/.config/wallp"
+ printf '%s\n' 'OUTPUT_H=DP-1' 'OUTPUT_V=DP-3' \
+ 'DEFAULT_H=/dh.png' 'DEFAULT_V=/dv.png' > "$HOME/.config/wallp/wallp.conf"
+ main --restore --theme tflag
+ [ "$(cat "$HOME/.config/wallp/theme")" = "tflag" ]
+}