summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorCasey Rodarmor <casey@rodarmor.com>2016-11-18 15:21:27 -0800
committerAnish Athalye <me@anishathalye.com>2016-11-23 14:11:45 -0500
commitd2e20c77db3811d8d0ef640a743f8dcc85075fdc (patch)
tree8e1b400afc354b383d16201d1855cc0aa6f472e4 /test
parentb482cbda585848c0d5f5345711fe338e319c0adf (diff)
Allow empty link sources
If the source for a link is null, use the basename of the destination with a single leading '.' removed, if present.
Diffstat (limited to 'test')
-rw-r--r--test/tests/link-default-source.bash26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/tests/link-default-source.bash b/test/tests/link-default-source.bash
new file mode 100644
index 0000000..60527d9
--- /dev/null
+++ b/test/tests/link-default-source.bash
@@ -0,0 +1,26 @@
+test_description='link uses destination if source is null'
+. '../test-lib.bash'
+
+test_expect_success 'setup' '
+echo "apple" > ${DOTFILES}/f &&
+echo "grape" > ${DOTFILES}/fd
+'
+
+test_expect_success 'run' '
+run_dotbot <<EOF
+- link:
+ ~/f:
+ ~/.f:
+ ~/fd:
+ force: false
+ ~/.fd:
+ force: false
+EOF
+'
+
+test_expect_success 'test' '
+grep "apple" ~/f &&
+grep "apple" ~/.f &&
+grep "grape" ~/fd &&
+grep "grape" ~/.fd
+'