aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-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" ]
+}