From 0f52ddcc2712573687ded1698ba0ac9b26168e00 Mon Sep 17 00:00:00 2001 From: danix Date: Thu, 11 Jun 2026 09:48:38 +0200 Subject: 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 --- tests/wallp.bats | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'tests') 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" ] +} -- cgit v1.2.3