From a86cde50de4bd8da0b5eaf6f1936269bafd29c8e Mon Sep 17 00:00:00 2001 From: Overbool Date: Thu, 4 Oct 2018 23:09:39 +0800 Subject: [PATCH] test(files): add test for force flag License: MIT Signed-off-by: Overbool --- test/sharness/t0250-files-api.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/sharness/t0250-files-api.sh b/test/sharness/t0250-files-api.sh index 7b97f31de..793e168be 100755 --- a/test/sharness/t0250-files-api.sh +++ b/test/sharness/t0250-files-api.sh @@ -629,6 +629,20 @@ test_files_api() { test_expect_success "repo gc $EXTRA" ' ipfs repo gc ' + + # test rm + + test_expect_success "remove file forcibly" ' + echo "hello world" | ipfs files write --create /forcibly && + ipfs files rm --force /forcibly && + verify_dir_contents / + ' + + test_expect_success "remove directory forcibly" ' + ipfs files mkdir /forcibly-dir && + ipfs files rm --force /forcibly-dir && + verify_dir_contents / + ' } # test offline and online