1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-12 09:33:30 +00:00

refactor links and add more tests

This commit is contained in:
deadc0de6
2019-04-04 12:13:47 +02:00
parent 584927f10b
commit 5f6cd81465
11 changed files with 679 additions and 73 deletions

View File

@@ -113,6 +113,7 @@ cd ${ddpath} | ${bin} compare -c ${cfg} -p p1
cat ${cfg}
# fail if find some of these entries
echo "========> test for bad entries"
set +e
grep 'link_children: true' ${cfg} >/dev/null && exit 1
grep 'link_children: false' ${cfg} >/dev/null && exit 1
@@ -123,12 +124,13 @@ grep 'link_by_default: false' ${cfg} >/dev/null && exit 1
set -e
# test values have been correctly updated
echo "========> test for updated entries"
dotfiles=`cd ${ddpath} | ${bin} listfiles -c ${cfg} -p p1 | grep -v '^ '`
echo "${dotfiles}" | grep '^f_link ' | grep ', link: parent)'
echo "${dotfiles}" | grep '^f_link ' | grep ', link: link)'
echo "${dotfiles}" | grep '^f_nolink ' | grep ', link: nolink)'
echo "${dotfiles}" | grep '^f_nolink1 ' | grep ', link: nolink)'
echo "${dotfiles}" | grep '^f_children ' | grep ', link: children)'
echo "${dotfiles}" | grep '^f_children2 ' | grep ', link: children)'
echo "${dotfiles}" | grep '^f_children ' | grep ', link: link_children)'
echo "${dotfiles}" | grep '^f_children2 ' | grep ', link: link_children)'
echo "${dotfiles}" | grep '^f_children3 ' | grep ', link: nolink)'
## CLEANING