From 490ed41c454184aa01b0a6a1d534c88d6997ad5f Mon Sep 17 00:00:00 2001 From: Juan Batiz-Benet Date: Tue, 28 Jul 2015 06:13:27 -0700 Subject: [PATCH] sharness/ipfs refs bigger tests License: MIT Signed-off-by: Juan Batiz-Benet --- test/sharness/t0080-repo.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/test/sharness/t0080-repo.sh b/test/sharness/t0080-repo.sh index 9ec8662b5..6e7b9203c 100755 --- a/test/sharness/t0080-repo.sh +++ b/test/sharness/t0080-repo.sh @@ -187,6 +187,29 @@ test_expect_success "'ipfs refs --unique --recursive' is correct" ' test_cmp expected line_count ' +test_expect_success "'ipfs refs --recursive (bigger)'" ' + mkdir -p b/c/d/e && + echo "content1" >b/f && + echo "content1" >b/c/f1 && + echo "content1" >b/c/d/f2 && + echo "content2" >b/c/f2 && + echo "content2" >b/c/d/f1 && + echo "content2" >b/c/d/e/f && + cp -r b b2 && mv b2 b/b2 && + cp -r b b3 && mv b3 b/b3 && + cp -r b b4 && mv b4 b/b4 && + hash=$(ipfs add -r -q b | tail -n1) && + ipfs refs -r "$hash" | wc -l | sed "s/^ *//g" >actual && + echo "79" >expected && + test_cmp expected actual +' + +test_expect_success "'ipfs refs --unique --recursive (bigger)'" ' + ipfs refs -r "$hash" | sort | uniq >expected && + ipfs refs -r -u "$hash" | sort >actual && + test_cmp expected actual +' + test_kill_ipfs_daemon test_done