Replace head piping with --hash option in t0250
License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
Jakub Sztandera committed
May 18, 2016 at 07:01 UTC
fea0b940d6ed31439097d1863478da6b3c7213fd
1 file changed
+10
-10
test/sharness/t0250-files-api.sh
+10
-10
@@ -76,7 +76,7 @@ test_files_api() {
76
77
test_expect_success "stat --hash gives only hash" '
78
ipfs files stat --hash / >actual &&
79
- head -1 stat >expected &&
79
+ head -n1 stat >expected &&
80
test_cmp expected actual
81
'
82
@@ -96,7 +96,7 @@ test_files_api() {
96
'
97
98
test_expect_success "check root hash" '
99
- ipfs files stat / | head -n1 > roothash
99
+ ipfs files stat --hash / > roothash
100
'
101
102
test_expect_success "cannot mkdir /" '
@@ -104,7 +104,7 @@ test_files_api() {
104
'
105
106
test_expect_success "check root hash was not changed" '
107
- ipfs files stat / | head -n1 > roothashafter &&
107
+ ipfs files stat --hash / > roothashafter &&
108
test_cmp roothash roothashafter
109
'
110
@@ -197,7 +197,7 @@ test_files_api() {
197
'
198
199
test_expect_success "check root hash" '
200
- ipfs files stat / | head -n1 > roothash
200
+ ipfs files stat --hash / > roothash
201
'
202
203
test_expect_success "cannot remove root" '
@@ -205,7 +205,7 @@ test_files_api() {
205
'
206
207
test_expect_success "check root hash was not changed" '
208
- ipfs files stat / | head -n1 > roothashafter &&
208
+ ipfs files stat --hash / > roothashafter &&
209
test_cmp roothash roothashafter
210
'
211
@@ -303,12 +303,12 @@ test_files_api() {
303
'
304
305
test_expect_success "cant write to negative offset" '
306
- ipfs files stat /cats/ipfs | head -n1 > filehash &&
306
+ ipfs files stat --hash /cats/ipfs > filehash &&
307
test_expect_code 1 ipfs files write --offset -1 /cats/ipfs < output
308
'
309
310
test_expect_success "verify file was not changed" '
311
- ipfs files stat /cats/ipfs | head -n1 > afterhash &&
311
+ ipfs files stat --hash /cats/ipfs > afterhash &&
312
test_cmp filehash afterhash
313
'
314
@@ -335,12 +335,12 @@ test_files_api() {
335
'
336
337
test_expect_success "cannot write to directory" '
338
- ipfs files stat /cats | head -n1 > dirhash &&
338
+ ipfs files stat --hash /cats > dirhash &&
339
test_expect_code 1 ipfs files write /cats < output
340
'
341
342
test_expect_success "verify dir was not changed" '
343
- ipfs files stat /cats | head -n1 > afterdirhash &&
343
+ ipfs files stat --hash /cats > afterdirhash &&
344
test_cmp dirhash afterdirhash
345
'
346
@@ -363,7 +363,7 @@ test_files_api() {
363
'
364
365
test_expect_success "changes bubbled up to root on inspection" '
366
- ipfs files stat / | head -n1 > root_hash
366
+ ipfs files stat --hash / > root_hash
367
'
368
369
test_expect_success "root hash looks good" '