sharness/ipfs refs bigger tests
License: MIT Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
Juan Batiz-Benet committed
Jul 28, 2015 at 06:13 UTC
490ed41c454184aa01b0a6a1d534c88d6997ad5f
1 file changed
+23
test/sharness/t0080-repo.sh
+23
@@ -187,6 +187,29 @@ test_expect_success "'ipfs refs --unique --recursive' is correct" '
187
test_cmp expected line_count
188
'
189
190
+test_expect_success "'ipfs refs --recursive (bigger)'" '
191
+ mkdir -p b/c/d/e &&
192
+ echo "content1" >b/f &&
193
+ echo "content1" >b/c/f1 &&
194
+ echo "content1" >b/c/d/f2 &&
195
+ echo "content2" >b/c/f2 &&
196
+ echo "content2" >b/c/d/f1 &&
197
+ echo "content2" >b/c/d/e/f &&
198
+ cp -r b b2 && mv b2 b/b2 &&
199
+ cp -r b b3 && mv b3 b/b3 &&
200
+ cp -r b b4 && mv b4 b/b4 &&
201
+ hash=$(ipfs add -r -q b | tail -n1) &&
202
+ ipfs refs -r "$hash" | wc -l | sed "s/^ *//g" >actual &&
203
+ echo "79" >expected &&
204
+ test_cmp expected actual
205
+'
206
+
207
+test_expect_success "'ipfs refs --unique --recursive (bigger)'" '
208
+ ipfs refs -r "$hash" | sort | uniq >expected &&
209
+ ipfs refs -r -u "$hash" | sort >actual &&
210
+ test_cmp expected actual
211
+'
212
+
213
test_kill_ipfs_daemon
214
215
test_done