aboutsummaryrefslogtreecommitdiffstats
path: root/tests/wallp.bats
diff options
context:
space:
mode:
authordanix <danix@danix.xyz>2026-06-11 09:50:02 +0200
committerdanix <danix@danix.xyz>2026-06-11 09:50:02 +0200
commit2e047897346ac58fb005711d9648b618a2d77b96 (patch)
tree709ab751a257a5ec2584c32fd533bb9501883cd9 /tests/wallp.bats
parent0f52ddcc2712573687ded1698ba0ac9b26168e00 (diff)
downloadwallp-2e047897346ac58fb005711d9648b618a2d77b96.tar.gz
wallp-2e047897346ac58fb005711d9648b618a2d77b96.zip
feat: parse --set H=/V= arguments
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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="* ]]
+}