aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/wallp.bats17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/wallp.bats b/tests/wallp.bats
index 1307eeb..3445ddb 100644
--- a/tests/wallp.bats
+++ b/tests/wallp.bats
@@ -37,3 +37,20 @@ teardown() {
run expand_tilde '/abs/b.png'
[ "$output" = "/abs/b.png" ]
}
+
+@test "parse_conf reads keys and expands tilde in paths" {
+ conf="$HOME/c.conf"
+ printf '%s\n' \
+ '# comment' '' \
+ 'THEME=mytheme' \
+ 'OUTPUT_H=DP-1' \
+ 'OUTPUT_V=DP-3' \
+ 'DEFAULT_H=~/p/h.png' \
+ 'DEFAULT_V=/abs/v.png' > "$conf"
+ parse_conf "$conf"
+ [ "$CONF_THEME" = "mytheme" ]
+ [ "$CONF_OUTPUT_H" = "DP-1" ]
+ [ "$CONF_OUTPUT_V" = "DP-3" ]
+ [ "$CONF_DEFAULT_H" = "$HOME/p/h.png" ]
+ [ "$CONF_DEFAULT_V" = "/abs/v.png" ]
+}