diff options
author | Anish Athalye <me@anishathalye.com> | 2020-01-03 16:46:19 -0500 |
---|---|---|
committer | Anish Athalye <me@anishathalye.com> | 2020-01-03 16:46:19 -0500 |
commit | ec8498ffb88d43c7d0648033d3d758ebb96a9378 (patch) | |
tree | d0f4443ea7f55931a9df52e6a36c51cadd340fba /test | |
parent | 3fcc13d803f4f0190d997f71f3af693ecef3e4c5 (diff) | |
parent | 320d5d0123b045fe922cf576d8d65e2db0517910 (diff) |
Merge branch 'ypid/add/link_real_path_option'
Diffstat (limited to 'test')
-rw-r--r-- | test/tests/link-canonicalize.bash | 20 | ||||
-rw-r--r-- | test/tests/link-no-canonicalize.bash | 23 |
2 files changed, 43 insertions, 0 deletions
diff --git a/test/tests/link-canonicalize.bash b/test/tests/link-canonicalize.bash new file mode 100644 index 0000000..34015c8 --- /dev/null +++ b/test/tests/link-canonicalize.bash @@ -0,0 +1,20 @@ +test_description='linking canonicalizes path by default' +. '../test-lib.bash' + +test_expect_success 'setup' ' +echo "apple" > ${DOTFILES}/f && +ln -s dotfiles dotfiles-symlink +' + +test_expect_success 'run' ' +cat > "${DOTFILES}/${INSTALL_CONF}" <<EOF +- link: + ~/.f: + path: f +EOF +${DOTBOT_EXEC} -c dotfiles-symlink/${INSTALL_CONF} +' + +test_expect_success 'test' ' +[ "$(readlink ~/.f | cut -d/ -f4-)" = "dotfiles/f" ] +' diff --git a/test/tests/link-no-canonicalize.bash b/test/tests/link-no-canonicalize.bash new file mode 100644 index 0000000..f9ccb99 --- /dev/null +++ b/test/tests/link-no-canonicalize.bash @@ -0,0 +1,23 @@ +test_description='linking path canonicalization can be disabled' +. '../test-lib.bash' + +test_expect_success 'setup' ' +echo "apple" > ${DOTFILES}/f && +ln -s dotfiles dotfiles-symlink +' + +test_expect_success 'run' ' +cat > "${DOTFILES}/${INSTALL_CONF}" <<EOF +- defaults: + link: + canonicalize-path: false +- link: + ~/.f: + path: f +EOF +${DOTBOT_EXEC} -c ./dotfiles-symlink/${INSTALL_CONF} +' + +test_expect_success 'test' ' +[ "$(readlink ~/.f | cut -d/ -f4-)" = "dotfiles-symlink/f" ] +' |