Skip to content

Commit

Permalink
test(cmd): add test case for silent option for command repo gc
Browse files Browse the repository at this point in the history
  • Loading branch information
will7200 committed Apr 13, 2020
1 parent e3fdc5a commit d17faf9
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/sharness/t0080-repo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit d17faf9

Please sign in to comment.