@@ -13,6 +13,7 @@ CIDb32="bafybeibxm2nsadl3fnxv2sxcxmxaco2jl53wpeorjdzidjwf5aqdg7wa6u"
13
13
CIDbase=" QmYNmQKp6SuaVrpgWRsPTgCQCnpxUYGq76YEKBXuj2N4H6"
14
14
CIDb32pb=" bafybeievd6mwe6vcwnkwo3eizs3h7w3a34opszbyfxziqdxguhjw7imdve"
15
15
CIDb32raw=" bafkreievd6mwe6vcwnkwo3eizs3h7w3a34opszbyfxziqdxguhjw7imdve"
16
+ CIDb32dagcbor=" bafyreievd6mwe6vcwnkwo3eizs3h7w3a34opszbyfxziqdxguhjw7imdve"
16
17
17
18
test_expect_success " cid base32 works" '
18
19
echo $CIDb32 > expected &&
@@ -284,13 +285,28 @@ test_expect_success "cid hashes --numeric" '
284
285
285
286
test_expect_success " cid format -c raw" '
286
287
echo $CIDb32raw > expected &&
287
- ipfs cid format --codec raw -b base32 $CIDb32pb > actual &&
288
+ ipfs cid format --mc raw -b base32 $CIDb32pb > actual &&
288
289
test_cmp actual expected
289
290
'
290
291
291
- test_expect_success " cid format -c protobuf -v 0" '
292
+ test_expect_success " cid format --mc dag-pb -v 0" '
292
293
echo $CIDbase > expected &&
293
- ipfs cid format --codec dag-pb -v 0 $CIDb32raw > actual &&
294
+ ipfs cid format --mc dag-pb -v 0 $CIDb32raw > actual &&
295
+ test_cmp actual expected
296
+ '
297
+
298
+ test_expect_success " cid format --mc dag-cbor" '
299
+ echo $CIDb32dagcbor > expected &&
300
+ ipfs cid format --mc dag-cbor $CIDb32pb > actual &&
301
+ test_cmp actual expected
302
+ '
303
+
304
+ # this was an old flag that we removed, explicitly to force an error
305
+ # so the user would read about the new multicodec names introduced
306
+ # by https://github.com/ipfs/go-cid/commit/b2064d74a8b098193b316689a715cdf4e4934805
307
+ test_expect_success " cid format --codec fails" '
308
+ echo "Error: unknown option \"codec\"" > expected &&
309
+ test_expect_code 1 ipfs cid format --codec protobuf 2> actual &&
294
310
test_cmp actual expected
295
311
'
296
312
0 commit comments