@cryptotaxi247 / kubo / commits / 45ed27e27

test/sharness: get: Quote variables

Matt Bell committed Jan 26, 2015 at 17:00 UTC 45ed27e27333c22dbca0cead5cdeffc92d52f6a8
1 file changed +19 -19
test/sharness/t0090-get.sh
+19 -19
@@ -23,56 +23,56 @@ test_expect_success "'ipfs get --help' output looks good" '
23 test_expect_success "ipfs get succeeds" '
24 echo "Hello Worlds!" > data &&
25 HASH=`ipfs add -q data` &&
26 - ipfs get $HASH > actual
26 + ipfs get "$HASH" > actual
27 '
28
29 test_expect_success "ipfs get output looks good" '
30 - echo "Saving file(s) to $HASH
30 + echo "Saving file(s) to "$HASH"
31 " > expected &&
32 test_cmp expected actual
33 '
34
35 test_expect_success "ipfs get file output looks good" '
36 - test_cmp $HASH data
36 + test_cmp "$HASH" data
37 '
38
39 test_expect_success "ipfs get errors when trying to overwrite a file" '
40 - test_must_fail ipfs get $HASH > actual &&
41 - rm $HASH
40 + test_must_fail ipfs get "$HASH" > actual &&
41 + rm "$HASH"
42 '
43
44 test_expect_success "ipfs get -a succeeds" '
45 - ipfs get $HASH -a > actual
45 + ipfs get "$HASH" -a > actual
46 '
47
48 test_expect_success "ipfs get -a output looks good" '
49 - echo "Saving archive to $HASH.tar
49 + echo "Saving archive to "$HASH".tar
50 " > expected &&
51 test_cmp expected actual
52 '
53
54 test_expect_success "ipfs get -a archive output is valid" '
55 tar -xf "$HASH".tar &&
56 - test_cmp $HASH data &&
56 + test_cmp "$HASH" data &&
57 rm "$HASH".tar &&
58 - rm $HASH
58 + rm "$HASH"
59 '
60
61 test_expect_success "ipfs get -a -C succeeds" '
62 - ipfs get $HASH -a -C > actual
62 + ipfs get "$HASH" -a -C > actual
63 '
64
65 test_expect_success "ipfs get -a -C output looks good" '
66 - echo "Saving archive to $HASH.tar.gz
66 + echo "Saving archive to "$HASH".tar.gz
67 " > expected &&
68 test_cmp expected actual
69 '
70
71 test_expect_failure "gzipped tar archive output is valid" '
72 - tar -zxf $HASH.tar.gz &&
73 - test_cmp $HASH data &&
72 + tar -zxf "$HASH".tar.gz &&
73 + test_cmp "$HASH" data &&
74 rm "$HASH".tar.gz &&
75 - rm $HASH
75 + rm "$HASH"
76 '
77
78 test_expect_success "ipfs get succeeds (directory)" '
@@ -81,11 +81,11 @@ test_expect_success "ipfs get succeeds (directory)" '
81 mkdir dir/b &&
82 echo "Hello, Worlds!" > dir/b/c &&
83 HASH2=`ipfs add -r -q dir | tail -n 1` &&
84 - ipfs get $HASH2 > actual
84 + ipfs get "$HASH2" > actual
85 '
86
87 test_expect_success "ipfs get output looks good (directory)" '
88 - echo "Saving file(s) to $HASH2
88 + echo "Saving file(s) to "$HASH2"
89 " > expected &&
90 test_cmp expected actual
91 '
@@ -93,11 +93,11 @@ test_expect_success "ipfs get output looks good (directory)" '
93 test_expect_success "ipfs get output is valid (directory)" '
94 test_cmp dir/a "$HASH2"/a &&
95 test_cmp dir/b/c "$HASH2"/b/c &&
96 - rm -r $HASH2
96 + rm -r "$HASH2"
97 '
98
99 test_expect_success "ipfs get -a -C succeeds (directory)" '
100 - ipfs get $HASH2 -a -C > actual
100 + ipfs get "$HASH2" -a -C > actual
101 '
102
103 test_expect_success "ipfs get -a -C output looks good (directory)" '
@@ -110,7 +110,7 @@ test_expect_success "gzipped tar archive output is valid (directory)" '
110 tar -zxf "$HASH2".tar.gz &&
111 test_cmp dir/a "$HASH2"/a &&
112 test_cmp dir/b/c "$HASH2"/b/c &&
113 - rm -r $HASH2
113 + rm -r "$HASH2"
114 '
115
116 test_kill_ipfs_daemon