File tree 1 file changed +14
-0
lines changed
1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -94,6 +94,20 @@ test_codec () {
94
94
test_codec " JSON" " json"
95
95
test_codec " CBOR" " cbor"
96
96
97
+ test_expect_success " GET JSON as CBOR produces DAG-CBOR output" '
98
+ CID=$(echo "{ \"test\": \"json\" }" | ipfs dag put --input-codec json --store-codec json) &&
99
+ curl -s "http://127.0.0.1:$GWAY_PORT/ipfs/$CID?format=cbor" > curl_output 2>&1 &&
100
+ ipfs dag get --output-codec dag-cbor $CID > ipfs_dag_get_output 2>&1 &&
101
+ test_cmp ipfs_dag_get_output curl_output
102
+ '
103
+
104
+ test_expect_success " GET CBOR as JSON produces DAG-JSON output" '
105
+ CID=$(echo "{ \"test\": \"json\" }" | ipfs dag put --input-codec json --store-codec cbor) &&
106
+ curl -s "http://127.0.0.1:$GWAY_PORT/ipfs/$CID?format=json" > curl_output 2>&1 &&
107
+ ipfs dag get --output-codec dag-json $CID > ipfs_dag_get_output 2>&1 &&
108
+ test_cmp ipfs_dag_get_output curl_output
109
+ '
110
+
97
111
test_kill_ipfs_daemon
98
112
99
113
test_done
You can’t perform that action at this time.
0 commit comments