sharness tests for --only-hash
License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com>
Jeromy committed
Jun 23, 2015 at 09:04 UTC
60ad7a5afc7059e418755d3ffcd194eca857a47e
2 files changed
+22
test/sharness/t0040-add-and-cat.sh
+8
@@ -39,6 +39,14 @@ test_expect_success "ipfs add output looks good" '
39
test_cmp expected actual
40
'
41
42
+test_expect_success "ipfs add --only-hash succeeds" '
43
+ ipfs add --only-hash mountdir/hello.txt > oh_actual
44
+'
45
+
46
+test_expect_success "ipfs add --only-hash output looks good" '
47
+ ipfs add --only-hash mountdir/hello.txt > oh_actual
48
+'
49
+
50
test_expect_success "ipfs cat succeeds" '
51
ipfs cat "$HASH" >actual
52
'
test/sharness/t0041-add-cat-offline.sh
+14
@@ -15,6 +15,20 @@ test_expect_success "ipfs add file succeeds" '
15
HASH=$(ipfs add -q afile)
16
'
17
18
+test_expect_success "ipfs add output looks good" '
19
+ echo Qmb1EXrDyKhNWfvLPYK4do3M9nU7BuLAcbqBir6aUrDsRY > expected &&
20
+ echo $HASH > actual &&
21
+ test_cmp expected actual
22
+'
23
+
24
+test_expect_success "ipfs add --only-hash succeeds" '
25
+ ipfs add -q --only-hash afile > ho_output
26
+'
27
+
28
+test_expect_success "ipfs add --only-hash output looks good" '
29
+ test_cmp expected ho_output
30
+'
31
+
32
test_expect_success "ipfs cat file suceeds" '
33
ipfs cat $HASH > out_1
34
'