From d30152cfe9ed3f763cce089b86c0a2983f3e19a3 Mon Sep 17 00:00:00 2001 From: Stephen Whitmore Date: Thu, 7 Apr 2016 12:38:09 -0700 Subject: [PATCH] Adds tests for "ipfs add -rn" License: MIT Signed-off-by: Stephen Whitmore --- test/sharness/t0040-add-and-cat.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/sharness/t0040-add-and-cat.sh b/test/sharness/t0040-add-and-cat.sh index 1dfeea04d..948167dd2 100755 --- a/test/sharness/t0040-add-and-cat.sh +++ b/test/sharness/t0040-add-and-cat.sh @@ -285,6 +285,23 @@ test_expect_success "'ipfs add -r' output looks good" ' test_cmp expected actual ' +test_expect_success "'ipfs add -rn' succeeds" ' + mkdir mountdir/moons && + echo "Hello Europa!" >mountdir/moons/europa.txt && + echo "Hello Titan!" >mountdir/moons/titan.txt && + ipfs add -rn mountdir/moons >actual +' + +test_expect_success "'ipfs add -rn' output looks good" ' + MOONS="QmUzSf98B1y5Aw5UcaV5SnAEDNzsppxfigbKjciy57hNRv" && + EUROPA="Qmbjg7zWdqdMaK2BucPncJQDxiALExph5k3NkQv5RHpccu" && + TITAN="QmZzppb9WHn552rmRqpPfgU5FEiHH6gDwi3MrB9cTdPwdb" && + echo "added $EUROPA moons/europa.txt" >expected && + echo "added $TITAN moons/titan.txt" >>expected && + echo "added $MOONS moons" >>expected && + test_cmp expected actual +' + test_expect_success "ipfs cat accept many hashes from stdin" ' { echo "$MARS"; echo "$VENUS"; } | ipfs cat >actual '