Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
a4e72871
Commit
a4e72871
authored
Sep 02, 2015
by
Jeromy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add tests for symlinks
License: MIT Signed-off-by:
Jeromy
<
jeromyj@gmail.com
>
parent
5ba7d616
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
0 deletions
+58
-0
test/sharness/t0044-add-symlink.sh
test/sharness/t0044-add-symlink.sh
+58
-0
No files found.
test/sharness/t0044-add-symlink.sh
0 → 100755
View file @
a4e72871
#!/bin/bash
#
# Copyright (c) 2014 Christian Couder
# MIT Licensed; see the LICENSE file in this repository.
#
test_description
=
"Test add -w"
.
lib/test-lib.sh
test_expect_success
"creating files succeeds"
'
mkdir -p files/foo &&
mkdir -p files/bar &&
echo "some text" > files/foo/baz &&
ln -s files/foo/baz files/bar/baz &&
ln -s files/does/not/exist files/bad
'
test_add_symlinks
()
{
test_expect_success
"ipfs add files succeeds"
'
ipfs add -q -r files | tail -n 1 > filehash_out
'
test_expect_success
"output looks good"
'
echo QmWdiHKoeSW8G1u7ATCgpx4yMoUhYaJBQGkyPLkS9goYZ8 > filehash_exp &&
test_cmp filehash_out filehash_exp
'
test_expect_success
"adding a symlink adds the link itself"
'
ipfs add -q files/bar/baz > goodlink_out
'
test_expect_success
"output looks good"
'
echo "QmdocmZeF7qwPT9Z8SiVhMSyKA2KKoA2J7jToW6z6WBmxR" > goodlink_exp &&
test_cmp goodlink_out goodlink_exp
'
test_expect_success
"adding a broken symlink works"
'
ipfs add -q files/bad > badlink_out
'
test_expect_success
"output looks good"
'
echo "QmWYN8SEXCgNT2PSjB6BnxAx6NJQtazWoBkTRH9GRfPFFQ" > badlink_exp &&
test_cmp badlink_out badlink_exp
'
}
test_init_ipfs
test_add_symlinks
test_launch_ipfs_daemon
test_add_symlinks
test_kill_ipfs_daemon
test_done
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment