Skip to content

Commit 43459c9

Browse files
will7200lidel
authored andcommitted
test(cmd): add test case for silent option for command repo gc
1 parent 9b679af commit 43459c9

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/sharness/t0080-repo.sh

+11
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,17 @@ test_expect_success "ipfs repo gc fully reverse ipfs add (part 1)" '
5555
ipfs pin rm -r $hash &&
5656
ipfs repo gc
5757
'
58+
test_expect_success "'ipfs repo gc --silent' succeeds (no output)" '
59+
echo "should be empty" >bfile &&
60+
HASH2=`ipfs add -q bfile` &&
61+
ipfs cat "$HASH2" >expected11 &&
62+
test_cmp expected11 bfile &&
63+
ipfs pin rm -r "$HASH2" &&
64+
ipfs repo gc --silent >gc_out_empty &&
65+
test_cmp /dev/null gc_out_empty &&
66+
test_must_fail ipfs cat "$HASH2" 2>err_expected1 &&
67+
grep "Error: merkledag: not found" err_expected1
68+
'
5869

5970
test_kill_ipfs_daemon
6071

0 commit comments

Comments
 (0)