Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(add): add test for issue \#5456 #5493

Merged
merged 1 commit into from
Sep 20, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions test/sharness/t0040-add-and-cat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,36 @@ test_add_cat_file() {
echo "IPFS" > actual &&
test_cmp expected actual
'

test_expect_success "ipfs add -r ." '
mkdir test_current_dir &&
echo "Hey" > test_current_dir/hey &&
mkdir test_current_dir/hello &&
echo "World" > test_current_dir/hello/world &&
( cd test_current_dir &&
ipfs add -r . | tail -n1 > ../actual && cd ../ ) &&
rm -r test_current_dir
'

test_expect_success "ipfs add -r . output looks good" '
echo "added QmZQWnfcqJ6hNkkPvrY9Q5X39GP3jUnUbAV4AbmbbR3Cb1 test_current_dir" > expected
test_cmp expected actual
'

test_expect_success "ipfs add -r ./" '
mkdir test_current_dir &&
echo "Hey" > test_current_dir/hey &&
mkdir test_current_dir/hello &&
echo "World" > test_current_dir/hello/world &&
( cd test_current_dir &&
ipfs add -r ./ | tail -n1 > ../actual && cd ../ ) &&
rm -r test_current_dir
'

test_expect_success "ipfs add -r ./ output looks good" '
echo "added QmZQWnfcqJ6hNkkPvrY9Q5X39GP3jUnUbAV4AbmbbR3Cb1 test_current_dir" > expected
test_cmp expected actual
'
}

test_add_cat_5MB() {
Expand Down