From d17faf9e910c849b9e1ac945f08b3a2e6511c13c Mon Sep 17 00:00:00 2001 From: William Flores Date: Mon, 13 Apr 2020 11:36:07 -0700 Subject: [PATCH] test(cmd): add test case for silent option for command repo gc --- test/sharness/t0080-repo.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/sharness/t0080-repo.sh b/test/sharness/t0080-repo.sh index 3d228ea330e9..45860e3e8c59 100755 --- a/test/sharness/t0080-repo.sh +++ b/test/sharness/t0080-repo.sh @@ -55,6 +55,17 @@ test_expect_success "ipfs repo gc fully reverse ipfs add (part 1)" ' ipfs pin rm -r $hash && ipfs repo gc ' +test_expect_success "'ipfs repo gc --silent' succeeds (no output)" ' + echo "should be empty" >bfile && + HASH2=`ipfs add -q bfile` && + ipfs cat "$HASH2" >expected11 && + test_cmp expected11 bfile && + ipfs pin rm -r "$HASH2" && + ipfs repo gc --silent >gc_out_empty && + test_cmp /dev/null gc_out_empty && + test_must_fail ipfs cat "$HASH2" 2>err_expected1 && + grep "Error: merkledag: not found" err_expected1 +' test_kill_ipfs_daemon