t0040: add tests for ipfs cat with stdin
License: MIT Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Christian Couder committed
May 19, 2015 at 21:28 UTC
863f38625192a4559815a4a5313f959cfbb3f75e
1 file changed
+51
test/sharness/t0040-add-and-cat.sh
+51
@@ -48,6 +48,22 @@ test_expect_success "ipfs cat output looks good" '
48
test_cmp expected actual
49
'
50
51
+test_expect_success "ipfs cat succeeds with stdin opened (issue #1141)" '
52
+ cat mountdir/hello.txt | while read line; do ipfs cat "$HASH" >actual || exit; done
53
+'
54
+
55
+test_expect_success "ipfs cat output looks good" '
56
+ test_cmp expected actual
57
+'
58
+
59
+test_expect_success "ipfs cat accept hash from stdin" '
60
+ echo "$HASH" | ipfs cat >actual
61
+'
62
+
63
+test_expect_success "ipfs cat output looks good" '
64
+ test_cmp expected actual
65
+'
66
+
67
test_expect_success FUSE "cat ipfs/stuff succeeds" '
68
cat "ipfs/$HASH" >actual
69
'
@@ -84,6 +100,41 @@ test_expect_success "'ipfs add -r' output looks good" '
100
test_cmp expected actual
101
'
102
103
+test_expect_success "ipfs cat accept many hashes from stdin" '
104
+ { echo "$MARS"; echo "$VENUS"; } | ipfs cat >actual
105
+'
106
+
107
+test_expect_success "ipfs cat output looks good" '
108
+ cat mountdir/planets/mars.txt mountdir/planets/venus.txt >expected &&
109
+ test_cmp expected actual
110
+'
111
+
112
+test_expect_success "ipfs cat accept many hashes as args" '
113
+ ipfs cat "$MARS" "$VENUS" >actual
114
+'
115
+
116
+test_expect_success "ipfs cat output looks good" '
117
+ test_cmp expected actual
118
+'
119
+
120
+test_expect_success "ipfs cat with both arg and stdin" '
121
+ echo "$MARS" | ipfs cat "$VENUS" >actual
122
+'
123
+
124
+test_expect_success "ipfs cat output looks good" '
125
+ cat mountdir/planets/venus.txt >expected &&
126
+ test_cmp expected actual
127
+'
128
+
129
+test_expect_success "ipfs cat with two args and stdin" '
130
+ echo "$MARS" | ipfs cat "$VENUS" "$VENUS" >actual
131
+'
132
+
133
+test_expect_success "ipfs cat output looks good" '
134
+ cat mountdir/planets/venus.txt mountdir/planets/venus.txt >expected &&
135
+ test_cmp expected actual
136
+'
137
+
138
test_expect_success "go-random is installed" '
139
type random
140
'