@cryptotaxi247 / kubo / commits / 741cf7e79

sharness/t009-get: fix space/tabs

License: MIT Signed-off-by: Juan Batiz-Benet <juan@benet.ai>

Juan Batiz-Benet committed Aug 4, 2015 at 12:12 UTC 741cf7e79372254d23279bb7d987fb77fc9f1c9f
1 file changed +65 -65
test/sharness/t0090-get.sh
+65 -65
@@ -14,111 +14,111 @@ test_init_ipfs
14 test_get_cmd() {
15
16 test_expect_success "'ipfs get --help' succeeds" '
17 - ipfs get --help >actual
17 + ipfs get --help >actual
18 '
19 -
19 +
20 test_expect_success "'ipfs get --help' output looks good" '
21 - egrep "ipfs get.*<ipfs-path>" actual >/dev/null ||
22 - test_fsh cat actual
21 + egrep "ipfs get.*<ipfs-path>" actual >/dev/null ||
22 + test_fsh cat actual
23 '
24 -
24 +
25 test_expect_success "ipfs get succeeds" '
26 - echo "Hello Worlds!" >data &&
27 - HASH=`ipfs add -q data` &&
28 - ipfs get "$HASH" >actual
26 + echo "Hello Worlds!" >data &&
27 + HASH=`ipfs add -q data` &&
28 + ipfs get "$HASH" >actual
29 '
30 -
30 +
31 test_expect_success "ipfs get output looks good" '
32 - printf "%s\n\n" "Saving file(s) to $HASH" >expected &&
33 - test_cmp expected actual
32 + printf "%s\n\n" "Saving file(s) to $HASH" >expected &&
33 + test_cmp expected actual
34 '
35 -
35 +
36 test_expect_success "ipfs get file output looks good" '
37 - test_cmp "$HASH" data
37 + test_cmp "$HASH" data
38 '
39
40 # this started failing after this change. fixed in later commit
41 test_expect_failure "ipfs get errors when trying to overwrite a file" '
42 - test_must_fail ipfs get "$HASH" >actual &&
43 - rm "$HASH"
42 + test_must_fail ipfs get "$HASH" >actual &&
43 + rm "$HASH"
44 '
45 -
45 +
46 test_expect_success "ipfs get -a succeeds" '
47 - ipfs get "$HASH" -a >actual
47 + ipfs get "$HASH" -a >actual
48 '
49 -
49 +
50 test_expect_success "ipfs get -a output looks good" '
51 - printf "%s\n\n" "Saving archive to $HASH.tar" >expected &&
52 - test_cmp expected actual
51 + printf "%s\n\n" "Saving archive to $HASH.tar" >expected &&
52 + test_cmp expected actual
53 '
54 -
54 +
55 # TODO: determine why this fails
56 test_expect_failure "ipfs get -a archive output is valid" '
57 - tar -xf "$HASH".tar &&
58 - test_cmp "$HASH" data &&
59 - rm "$HASH".tar &&
60 - rm "$HASH"
57 + tar -xf "$HASH".tar &&
58 + test_cmp "$HASH" data &&
59 + rm "$HASH".tar &&
60 + rm "$HASH"
61 '
62 -
62 +
63 test_expect_success "ipfs get -a -C succeeds" '
64 - ipfs get "$HASH" -a -C >actual
64 + ipfs get "$HASH" -a -C >actual
65 '
66 -
66 +
67 test_expect_success "ipfs get -a -C output looks good" '
68 - printf "%s\n\n" "Saving archive to $HASH.tar.gz" >expected &&
69 - test_cmp expected actual
68 + printf "%s\n\n" "Saving archive to $HASH.tar.gz" >expected &&
69 + test_cmp expected actual
70 '
71 -
71 +
72 # TODO(mappum)
73 test_expect_failure "gzipped tar archive output is valid" '
74 - tar -zxf "$HASH".tar.gz &&
75 - test_cmp "$HASH" data &&
76 - rm "$HASH".tar.gz &&
77 - rm "$HASH"
74 + tar -zxf "$HASH".tar.gz &&
75 + test_cmp "$HASH" data &&
76 + rm "$HASH".tar.gz &&
77 + rm "$HASH"
78 '
79 -
79 +
80 test_expect_success "ipfs get succeeds (directory)" '
81 - mkdir -p dir &&
82 - touch dir/a &&
83 - mkdir -p dir/b &&
84 - echo "Hello, Worlds!" >dir/b/c &&
85 - HASH2=`ipfs add -r -q dir | tail -n 1` &&
86 - ipfs get "$HASH2" >actual
87 - '
88 -
81 + mkdir -p dir &&
82 + touch dir/a &&
83 + mkdir -p dir/b &&
84 + echo "Hello, Worlds!" >dir/b/c &&
85 + HASH2=`ipfs add -r -q dir | tail -n 1` &&
86 + ipfs get "$HASH2" >actual
87 + '
88 +
89 test_expect_success "ipfs get output looks good (directory)" '
90 - printf "%s\n\n" "Saving file(s) to $HASH2" >expected &&
91 - test_cmp expected actual
90 + printf "%s\n\n" "Saving file(s) to $HASH2" >expected &&
91 + test_cmp expected actual
92 '
93 -
93 +
94 test_expect_success "ipfs get output is valid (directory)" '
95 - test_cmp dir/a "$HASH2"/a &&
96 - test_cmp dir/b/c "$HASH2"/b/c &&
97 - rm -r "$HASH2"
95 + test_cmp dir/a "$HASH2"/a &&
96 + test_cmp dir/b/c "$HASH2"/b/c &&
97 + rm -r "$HASH2"
98 '
99 -
99 +
100 test_expect_success "ipfs get -a -C succeeds (directory)" '
101 - ipfs get "$HASH2" -a -C >actual
101 + ipfs get "$HASH2" -a -C >actual
102 '
103 -
103 +
104 test_expect_success "ipfs get -a -C output looks good (directory)" '
105 - printf "%s\n\n" "Saving archive to $HASH2.tar.gz" >expected &&
106 - test_cmp expected actual
105 + printf "%s\n\n" "Saving archive to $HASH2.tar.gz" >expected &&
106 + test_cmp expected actual
107 '
108 -
108 +
109 # TODO(mappum)
110 test_expect_failure "gzipped tar archive output is valid (directory)" '
111 - tar -zxf "$HASH2".tar.gz &&
112 - test_cmp dir/a "$HASH2"/a &&
113 - test_cmp dir/b/c "$HASH2"/b/c &&
114 - rm -r "$HASH2"
111 + tar -zxf "$HASH2".tar.gz &&
112 + test_cmp dir/a "$HASH2"/a &&
113 + test_cmp dir/b/c "$HASH2"/b/c &&
114 + rm -r "$HASH2"
115 '
116
117 - test_expect_success "ipfs get ../.. should fail" '
118 - echo "Error: invalid ipfs ref path" >expected &&
119 - test_must_fail ipfs get ../.. 2>actual &&
120 - test_cmp expected actual
121 - '
117 + test_expect_success "ipfs get ../.. should fail" '
118 + echo "Error: invalid ipfs ref path" >expected &&
119 + test_must_fail ipfs get ../.. 2>actual &&
120 + test_cmp expected actual
121 + '
122 }
123
124 # should work offline