From e51588ee77c1ec9933e11e4c50980ebbd5fca5b5 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Thu, 19 Jul 2018 18:14:52 -0700 Subject: [PATCH] test pin update tests #4999 and #5264 License: MIT Signed-off-by: Steven Allen --- test/sharness/t0085-pins.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/sharness/t0085-pins.sh b/test/sharness/t0085-pins.sh index c0c1bd4d4..9fac885e8 100755 --- a/test/sharness/t0085-pins.sh +++ b/test/sharness/t0085-pins.sh @@ -48,6 +48,18 @@ test_pins() { test_expect_success "unpin those hashes" ' cat hashes | ipfs pin rm ' + + test_expect_success "test pin update" ' + ipfs pin add "$HASH_A" && + ipfs pin ls > before_update && + test_should_contain "$HASH_A" before_update && + test_must_fail grep -q "$HASH_B" before_update && + ipfs pin update --unpin=true "$HASH_A" "$HASH_B" && + ipfs pin ls > after_update && + test_must_fail grep -q "$HASH_A" after_update && + test_should_contain "$HASH_B" after_update && + ipfs pin rm "$HASH_B" + ' } RANDOM_HASH=Qme8uX5n9hn15pw9p6WcVKoziyyC9LXv4LEgvsmKMULjnV