mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-04 15:39:43 +00:00
tests
This commit is contained in:
14
tests-ng/import-negative-ignore-all-but.sh
vendored
14
tests-ng/import-negative-ignore-all-but.sh
vendored
@@ -62,9 +62,9 @@ config:
|
||||
dotpath: dotfiles
|
||||
impignore:
|
||||
- "*"
|
||||
- "!*/c"
|
||||
- "!*/d"
|
||||
- "!*/x"
|
||||
- "!*/c/**"
|
||||
- "!*/d/**"
|
||||
- "!*/x/**"
|
||||
dotfiles:
|
||||
profiles:
|
||||
p1:
|
||||
@@ -79,10 +79,10 @@ cd "${ddpath}" | ${bin} import -f -c "${cfg}" --verbose --profile=p1 "${tmpd}/a/
|
||||
cd "${ddpath}" | ${bin} import -f -c "${cfg}" --verbose --profile=p1 "${tmpd}/a/x"
|
||||
set -e
|
||||
|
||||
[ -d "${basedir}/dotfiles/a/b" ] && (echo "/a/b created" && exit 1)
|
||||
grep_or_fail "updated" "${basedir}/dotfiles/a/c/acfile"
|
||||
grep_or_fail "updated" "${basedir}/dotfiles/a/d/adfile"
|
||||
grep_or_fail "updated" "${basedir}/dotfiles/a/x/axfile"
|
||||
[ -d "${basedir}/dotfiles/${tmpd}/a/b" ] && (echo "/a/b created" && exit 1)
|
||||
grep_or_fail "updated" "${basedir}/dotfiles/${tmpd}/a/c/acfile"
|
||||
grep_or_fail "updated" "${basedir}/dotfiles/${tmpd}/a/d/adfile"
|
||||
grep_or_fail "updated" "${basedir}/dotfiles/${tmpd}/a/x/axfile"
|
||||
|
||||
echo "OK"
|
||||
exit 0
|
||||
|
||||
2
tests-ng/include-order.sh
vendored
2
tests-ng/include-order.sh
vendored
@@ -86,7 +86,9 @@ _EOF
|
||||
# create the source
|
||||
mkdir -p "${tmps}"/dotfiles/
|
||||
echo "first" > "${tmps}"/dotfiles/first
|
||||
sleep 1
|
||||
echo "second" > "${tmps}"/dotfiles/second
|
||||
sleep 1
|
||||
echo "third" > "${tmps}"/dotfiles/third
|
||||
|
||||
attempts="3"
|
||||
|
||||
7
tests-ng/update-ignore-missing.sh
vendored
7
tests-ng/update-ignore-missing.sh
vendored
@@ -36,6 +36,7 @@ tmpd=$(mktemp -d --suffix='-dotdrop-tests-dest' || mktemp -d)
|
||||
cp -r "${dt}"/folder "${tmpd}"/
|
||||
touch "${tmpd}"/folder/b
|
||||
mkdir "${tmpd}"/folder/c
|
||||
touch "${tmpd}"/folder/c/cfile
|
||||
|
||||
clear_on_exit "${tmps}"
|
||||
clear_on_exit "${tmpd}"
|
||||
@@ -68,12 +69,12 @@ _EOF
|
||||
echo "[+] test with no ignore-missing setting"
|
||||
cd "${ddpath}" | ${bin} update -f -c "${cfg}" --verbose --profile=p1 --key thedotfile
|
||||
|
||||
[ ! -e "${dt}"/folder/b ] && echo "should have been updated" && exit 1
|
||||
[ ! -e "${dt}"/folder/c ] && echo "should have been updated" && exit 1
|
||||
[ ! -e "${dt}"/folder/b ] && echo "${dt}/folder/b should have been updated" && exit 1
|
||||
[ ! -e "${dt}"/folder/c/cfile ] && echo "${dt}/folder/c/cfile should have been updated" && exit 1
|
||||
|
||||
# Reset
|
||||
rm "${dt}"/folder/b
|
||||
rmdir "${dt}"/folder/c
|
||||
rm -rf "${dt}"/folder/c
|
||||
|
||||
#
|
||||
# Test with command-line flag
|
||||
|
||||
4
tests-ng/update.sh
vendored
4
tests-ng/update.sh
vendored
@@ -104,7 +104,9 @@ rm "${basedir}"/dotfiles/"${tmpd}"/dir1/file_in_dir1
|
||||
mkdir -p "${basedir}"/dotfiles/"${tmpd}"/dir1/file_in_dir1
|
||||
|
||||
# ensure changes applied correctly
|
||||
diff "${tmpd}"/dir1 "${basedir}"/dotfiles/"${tmpd}"/dir1
|
||||
echo "diff dir1"
|
||||
diff -r --suppress-common-lines "${tmpd}"/dir1 "${basedir}"/dotfiles/"${tmpd}"/dir1
|
||||
echo "diff uniquefile"
|
||||
diff "${tmpd}"/uniquefile "${basedir}"/dotfiles/"${tmpd}"/uniquefile
|
||||
[ ! -e "${basedir}"/dotfiles/"${tmpd}"/dir1/sub1/sub2/sub3/file ] && echo "sub does not exist" && exit 1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user