diff options
| author | danix <danix@danix.xyz> | 2026-06-11 09:44:51 +0200 |
|---|---|---|
| committer | danix <danix@danix.xyz> | 2026-06-11 09:44:51 +0200 |
| commit | 5d5da3a1b50eedb3c30aa209eb24aa7f579dc701 (patch) | |
| tree | 365200bfb958482e41064ba1e7440dd56b5b55f3 /tests | |
| parent | 104ec07c142ac74e68ee2d72df662a0adcd5b9c5 (diff) | |
| download | wallp-5d5da3a1b50eedb3c30aa209eb24aa7f579dc701.tar.gz wallp-5d5da3a1b50eedb3c30aa209eb24aa7f579dc701.zip | |
feat: parse_conf key=value config loader
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/wallp.bats | 17 |
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" ] +} |
