aboutsummaryrefslogtreecommitdiffstats
path: root/tests/wallp.bats
diff options
context:
space:
mode:
Diffstat (limited to 'tests/wallp.bats')
-rw-r--r--tests/wallp.bats27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/wallp.bats b/tests/wallp.bats
index b5c9ff7..52e6706 100644
--- a/tests/wallp.bats
+++ b/tests/wallp.bats
@@ -127,3 +127,30 @@ teardown() {
run pid_file_for V
[ "$output" = "$HOME/.cache/wallp/V.pid" ]
}
+
+@test "parse_set_args captures both" {
+ SET_H="" SET_V=""
+ parse_set_args "H=/a.png" "V=/b.png"
+ [ "$SET_H" = "/a.png" ]
+ [ "$SET_V" = "/b.png" ]
+}
+
+@test "parse_set_args partial leaves other empty" {
+ SET_H="" SET_V=""
+ parse_set_args "V=/only.png"
+ [ "$SET_H" = "" ]
+ [ "$SET_V" = "/only.png" ]
+}
+
+@test "parse_set_args expands tilde" {
+ SET_H="" SET_V=""
+ parse_set_args "H=~/x.png"
+ [ "$SET_H" = "$HOME/x.png" ]
+}
+
+@test "parse_set_args rejects unknown token" {
+ SET_H="" SET_V=""
+ run parse_set_args "Z=/bad.png"
+ [ "$status" -eq 1 ]
+ [[ "$output" == *"Z="* ]]
+}