Skip to content

Commit 603f20f

Browse files
committed
sharness: 'ipfs object put' protobuf
1 parent f675f3c commit 603f20f

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
test json for sharness test

test/sharness/t0051-object.sh

+20
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,16 @@ test_expect_success "'ipfs object put file.json' output looks good" '
5252
test_cmp expected_putOut actual_putOut
5353
'
5454

55+
test_expect_success "'ipfs object put file.pb' succeeds" '
56+
ipfs object put --encoding=protobuf ../t0051-object-data/testPut.pb > actual_putOut
57+
'
58+
59+
test_expect_success "'ipfs object put file.pb' output looks good" '
60+
HASH="QmUTSAdDi2xsNkDtLqjFgQDMEn5di3Ab9eqbrt4gaiNbUD" &&
61+
echo -n "added $HASH" > expected_putOut &&
62+
test_cmp expected_putOut actual_putOut
63+
'
64+
5565
test_expect_success "'ipfs object put' from stdin succeeds" '
5666
cat ../t0051-object-data/testPut.json | ipfs object put > actual_putStdinOut
5767
'
@@ -62,6 +72,16 @@ test_expect_success "'ipfs object put' from stdin output looks good" '
6272
test_cmp expected_putStdinOut actual_putStdinOut
6373
'
6474

75+
test_expect_success "'ipfs object put' from stdin (pb) succeeds" '
76+
cat ../t0051-object-data/testPut.pb | ipfs object put --inputenc=protobuf > actual_putPbStdinOut
77+
'
78+
79+
test_expect_success "'ipfs object put' from stdin (pb) output looks good" '
80+
HASH="QmUTSAdDi2xsNkDtLqjFgQDMEn5di3Ab9eqbrt4gaiNbUD" &&
81+
echo -n "added $HASH" > expected_putStdinOut &&
82+
test_cmp expected_putStdinOut actual_putPbStdinOut
83+
'
84+
6585

6686

6787
test_done

0 commit comments

Comments
 (0)