mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-04 16:49:42 +00:00
test for #423
This commit is contained in:
22
tests-ng/import-configs.sh
vendored
22
tests-ng/import-configs.sh
vendored
@@ -57,6 +57,9 @@ dotfiles:
|
|||||||
f_sub:
|
f_sub:
|
||||||
dst: ${tmpd}/sub
|
dst: ${tmpd}/sub
|
||||||
src: sub
|
src: sub
|
||||||
|
f_templ:
|
||||||
|
dst: ${tmpd}/templ
|
||||||
|
src: templ
|
||||||
profiles:
|
profiles:
|
||||||
p0:
|
p0:
|
||||||
include:
|
include:
|
||||||
@@ -70,6 +73,11 @@ profiles:
|
|||||||
pup:
|
pup:
|
||||||
include:
|
include:
|
||||||
- psubsub
|
- psubsub
|
||||||
|
plast:
|
||||||
|
dotfiles:
|
||||||
|
- f_templ
|
||||||
|
variables:
|
||||||
|
onevar: "has some"
|
||||||
_EOF
|
_EOF
|
||||||
|
|
||||||
cat > "${cfg2}" << _EOF
|
cat > "${cfg2}" << _EOF
|
||||||
@@ -95,6 +103,9 @@ profiles:
|
|||||||
psubsub:
|
psubsub:
|
||||||
dotfiles:
|
dotfiles:
|
||||||
- f_sub
|
- f_sub
|
||||||
|
plast:
|
||||||
|
variables:
|
||||||
|
somevar: "value"
|
||||||
_EOF
|
_EOF
|
||||||
|
|
||||||
# create the source
|
# create the source
|
||||||
@@ -118,6 +129,8 @@ mkdir -p "${tmps}"/dotfiles-other/subdir/sub
|
|||||||
echo "subsub" > "${tmps}"/dotfiles-other/subdir/sub/asub
|
echo "subsub" > "${tmps}"/dotfiles-other/subdir/sub/asub
|
||||||
echo "{{@@ _dotfile_abs_dst @@}}" >> "${tmps}"/dotfiles-other/subdir/sub/asub
|
echo "{{@@ _dotfile_abs_dst @@}}" >> "${tmps}"/dotfiles-other/subdir/sub/asub
|
||||||
|
|
||||||
|
echo "{{@@ onevar @@}} {{@@ somevar @@}}" > "${tmps}"/dotfiles/templ
|
||||||
|
|
||||||
# files comparison
|
# files comparison
|
||||||
cd "${ddpath}" | ${bin} files -c "${cfg1}" -G -p p0 | grep '^f_def'
|
cd "${ddpath}" | ${bin} files -c "${cfg1}" -G -p p0 | grep '^f_def'
|
||||||
cd "${ddpath}" | ${bin} files -c "${cfg1}" -G -p p1 | grep '^f_abc'
|
cd "${ddpath}" | ${bin} files -c "${cfg1}" -G -p p1 | grep '^f_abc'
|
||||||
@@ -133,6 +146,15 @@ cd "${ddpath}" | ${bin} compare -c "${cfg1}" -p p2 -V
|
|||||||
[ ! -s "${tmpd}"/def ] && echo "def not installed" && exit 1
|
[ ! -s "${tmpd}"/def ] && echo "def not installed" && exit 1
|
||||||
[ ! -s "${tmpd}"/subdir/sub/asub ] && echo "asub not installed" && exit 1
|
[ ! -s "${tmpd}"/subdir/sub/asub ] && echo "asub not installed" && exit 1
|
||||||
|
|
||||||
|
# test import profile variables
|
||||||
|
cd "${ddpath}" | ${bin} install -c "${cfg1}" -p plast -V -f
|
||||||
|
|
||||||
|
echo "test merge profile variables"
|
||||||
|
ls -l "${tmpd}"/
|
||||||
|
cat "${tmpd}"/templ
|
||||||
|
[ ! -e "${tmpd}"/templ ] && echo "templ not installed" && exit 1
|
||||||
|
grep "has some value" "${tmpd}"/templ
|
||||||
|
|
||||||
# test with non-existing dotpath this time
|
# test with non-existing dotpath this time
|
||||||
|
|
||||||
rm -rf "${tmps}"/dotfiles
|
rm -rf "${tmps}"/dotfiles
|
||||||
|
|||||||
Reference in New Issue
Block a user