diff --git a/test/sharness/t0040-add-and-cat.sh b/test/sharness/t0040-add-and-cat.sh index 03cdb75d4df7d3d187ea77fa16b1eeaa271c3a94..0e3e6fb08fdd12426836087b384d33677821c1d0 100755 --- a/test/sharness/t0040-add-and-cat.sh +++ b/test/sharness/t0040-add-and-cat.sh @@ -39,6 +39,14 @@ test_expect_success "ipfs add output looks good" ' test_cmp expected actual ' +test_expect_success "ipfs add --only-hash succeeds" ' + ipfs add --only-hash mountdir/hello.txt > oh_actual +' + +test_expect_success "ipfs add --only-hash output looks good" ' + ipfs add --only-hash mountdir/hello.txt > oh_actual +' + test_expect_success "ipfs cat succeeds" ' ipfs cat "$HASH" >actual ' diff --git a/test/sharness/t0041-add-cat-offline.sh b/test/sharness/t0041-add-cat-offline.sh index cb370eec00910f31c35f38e91347fa9e9a8c1747..a8c0e36a6afaf821772da881acd5b03743a8b174 100755 --- a/test/sharness/t0041-add-cat-offline.sh +++ b/test/sharness/t0041-add-cat-offline.sh @@ -15,6 +15,20 @@ test_expect_success "ipfs add file succeeds" ' HASH=$(ipfs add -q afile) ' +test_expect_success "ipfs add output looks good" ' + echo Qmb1EXrDyKhNWfvLPYK4do3M9nU7BuLAcbqBir6aUrDsRY > expected && + echo $HASH > actual && + test_cmp expected actual +' + +test_expect_success "ipfs add --only-hash succeeds" ' + ipfs add -q --only-hash afile > ho_output +' + +test_expect_success "ipfs add --only-hash output looks good" ' + test_cmp expected ho_output +' + test_expect_success "ipfs cat file suceeds" ' ipfs cat $HASH > out_1 '