diff --git a/test/sharness/t0051-object.sh b/test/sharness/t0051-object.sh index 95de4fda758..70f1ff5a113 100755 --- a/test/sharness/t0051-object.sh +++ b/test/sharness/t0051-object.sh @@ -223,6 +223,20 @@ test_object_cmd() { ipfs object stat $OUTPUT ' + test_expect_success "'ipfs object patch' check output block size" ' + DIR=$(ipfs object new unixfs-dir) + for i in {1..13} + do + DIR=$(ipfs object patch --force-block-size=false "$DIR" add-link "$DIR.jpg" "$DIR") + done + # This one will fail as it goes over the BS limit of 1MB. + test_expect_code 1 ipfs object patch --force-block-size=false "$DIR" add-link "$DIR.jpg" "$DIR" >patch_out 2>&1 + ' + + test_expect_success "ipfs object patch add-link output has the correct error" ' + grep "Error: object API does not support HAMT-sharding. To create big directories, please use the files API (MFS)" patch_out + ' + test_expect_success "'ipfs object new foo' shouldn't crash" ' test_expect_code 1 ipfs object new foo '