File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -46,4 +46,35 @@ echo "CumulativeSize: 18" >> expected_stat &&
46
46
test_cmp expected_stat actual_stat
47
47
'
48
48
49
+ # semicool way to get json inline without much escaping
50
+ objectPutJson=$( cat << EOF
51
+ {
52
+ "Data": "test json for sharness test"
53
+ }
54
+ EOF
55
+ )
56
+
57
+ test_expect_success " 'ipfs object put file.json' succeeds" '
58
+ echo $objectPutJson > file.json &&
59
+ ipfs object put file.json > actual_putOut
60
+ '
61
+
62
+ test_expect_success " 'ipfs object put file.json' output looks good" '
63
+ HASH="QmUTSAdDi2xsNkDtLqjFgQDMEn5di3Ab9eqbrt4gaiNbUD" &&
64
+ echo -n "added $HASH" > expected_putOut &&
65
+ test_cmp expected_putOut actual_putOut
66
+ '
67
+
68
+ test_expect_success " 'ipfs object put' from stdin succeeds" '
69
+ echo $objectPutJson | ipfs object put > actual_putStdinOut
70
+ '
71
+
72
+ test_expect_success " 'ipfs object put' from stdin output looks good" '
73
+ HASH="QmUTSAdDi2xsNkDtLqjFgQDMEn5di3Ab9eqbrt4gaiNbUD" &&
74
+ echo -n "added $HASH" > expected_putStdinOut &&
75
+ test_cmp expected_putStdinOut actual_putStdinOut
76
+ '
77
+
78
+
79
+
49
80
test_done
You can’t perform that action at this time.
0 commit comments