1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-04 18:34:48 +00:00

more tests

This commit is contained in:
deadc0de6
2023-04-13 21:54:59 +02:00
committed by deadc0de
parent caedd7cd8d
commit 82fd6348d2

View File

@@ -2,7 +2,7 @@
# author: deadc0de6 (https://github.com/deadc0de6)
# Copyright (c) 2023, deadc0de6
#
# test variables tree (see #383)
# test nested variables (see #383)
# returns 1 in case of error
#
@@ -49,6 +49,12 @@ variables:
hello2: "hello2"
z2:
wow2: "{{@@ hello2 @@}}"
a:
suba:
subsuba: "submarine"
b:
subb:
subsubb:
dotfiles:
f_abc:
dst: ${tmpd}/abc
@@ -63,6 +69,8 @@ _EOF
# create the dotfile
echo "wow1={{@@ wow1 @@}}" > "${tmps}"/dotfiles/abc
echo "wow2={{@@ z2.wow2 @@}}" >> "${tmps}"/dotfiles/abc
echo "subsuba={{@@ a.suba.subsuba @@}}" >> "${tmps}"/dotfiles/abc
echo "subsubb={{@@ b.subb.subsubb @@}}" >> "${tmps}"/dotfiles/abc
# install
cd "${ddpath}" | ${bin} install -f -c "${cfg}" -p p1 --verbose
@@ -72,6 +80,8 @@ cat "${tmpd}"/abc
[ ! -e "${tmpd}"/abc ] && echo "abc not installed" && exit 1
grep '^wow1=hello1' "${tmpd}"/abc >/dev/null
grep '^wow2=hello2' "${tmpd}"/abc >/dev/null
grep '^subsuba=submarine' "${tmpd}"/abc >/dev/null
grep '^subsubb=None' "${tmpd}"/abc >/dev/null
echo "OK"
exit 0