aboutsummaryrefslogtreecommitdiffstats
path: root/tests/wallp.bats
diff options
context:
space:
mode:
authordanix <danix@danix.xyz>2026-06-11 09:48:38 +0200
committerdanix <danix@danix.xyz>2026-06-11 09:48:38 +0200
commit0f52ddcc2712573687ded1698ba0ac9b26168e00 (patch)
treef75eef0bddd9c33c24646a468dc893691fc63a8a /tests/wallp.bats
parentc20cfb9423a48ca4ded7e6b7b3cd014a60499e33 (diff)
downloadwallp-0f52ddcc2712573687ded1698ba0ac9b26168e00.tar.gz
wallp-0f52ddcc2712573687ded1698ba0ac9b26168e00.zip
feat: output mapping + state path helpers
Add three helper functions for logical-to-physical output mapping and state file paths: output_for maps H|V to physical connectors, wall_file_for returns config paths, pid_file_for returns cache paths. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'tests/wallp.bats')
-rw-r--r--tests/wallp.bats22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/wallp.bats b/tests/wallp.bats
index 0ffed89..b5c9ff7 100644
--- a/tests/wallp.bats
+++ b/tests/wallp.bats
@@ -105,3 +105,25 @@ teardown() {
persist_theme "abc"
[ "$(cat "$HOME/.config/wallp/theme")" = "abc" ]
}
+
+@test "output_for maps logical to physical" {
+ CONF_OUTPUT_H="DP-1"; CONF_OUTPUT_V="DP-3"
+ run output_for H
+ [ "$output" = "DP-1" ]
+ run output_for V
+ [ "$output" = "DP-3" ]
+}
+
+@test "wall_file_for returns config paths" {
+ run wall_file_for H
+ [ "$output" = "$HOME/.config/wallp/wall_h" ]
+ run wall_file_for V
+ [ "$output" = "$HOME/.config/wallp/wall_v" ]
+}
+
+@test "pid_file_for returns cache paths" {
+ run pid_file_for H
+ [ "$output" = "$HOME/.cache/wallp/H.pid" ]
+ run pid_file_for V
+ [ "$output" = "$HOME/.cache/wallp/V.pid" ]
+}