Merge pull request #5493 from overbool/test/issue-#5456

test(add): add test for issue \#5456
This commit is contained in:
Steven Allen 2018-09-20 00:22:17 +00:00 committed by GitHub
commit 987fef1266
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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() {