Skip to content

Commit

Permalink
sharness: add test for symlink in the middle
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Jakub Sztandera <[email protected]>
  • Loading branch information
Kubuxu committed Jun 28, 2016
1 parent dafeb3e commit f35c53e
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion test/sharness/t0044-add-symlink.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ test_expect_success "creating files succeeds" '
mkdir -p files/badin
echo "some text" > files/foo/baz &&
ln -s ../foo/baz files/bar/baz &&
ln -s files/does/not/exist files/badin/bad
ln -s files/does/not/exist files/badin/bad &&
mkdir -p files2/a/b/c &&
echo "some other text" > files2/a/b/c/foo &&
ln -s b files2/a/d
'

test_add_symlinks() {
Expand Down Expand Up @@ -45,6 +48,13 @@ test_add_symlinks() {
echo "QmWYN8SEXCgNT2PSjB6BnxAx6NJQtazWoBkTRH9GRfPFFQ" > badlink_exp &&
test_cmp badlink_exp badlink_out
'

test_expect_success "adding with symlink in middle of path is same as\
adding with no symlink" '
ipfs add -rq files2/a/b/c > no_sym &&
ipfs add -rq files2/a/d/c > sym &&
test_cmp no_sym sym
'
}

test_init_ipfs
Expand Down

0 comments on commit f35c53e

Please sign in to comment.