From d656ade8237a9bbc802fb9e7ee6aa509067adab4 Mon Sep 17 00:00:00 2001 From: Overbool Date: Thu, 20 Sep 2018 07:54:39 +0800 Subject: [PATCH] test(add): add test for issue \#5456 License: MIT Signed-off-by: Overbool --- test/sharness/t0040-add-and-cat.sh | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/test/sharness/t0040-add-and-cat.sh b/test/sharness/t0040-add-and-cat.sh index ebee485bd3d..0ee4477cdcd 100755 --- a/test/sharness/t0040-add-and-cat.sh +++ b/test/sharness/t0040-add-and-cat.sh @@ -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() {