Skip to content

Commit f49ec1f

Browse files
committed
sharness: make put sharness test easier to follow
Address #3931 (review) License: MIT Signed-off-by: Steven Allen <[email protected]>
1 parent 79fec51 commit f49ec1f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/sharness/t0111-gateway-writeable.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,11 @@ test_expect_success "Replacing a file with PUT gives us the hash of the new tree
108108
echo "PUT $URL" &&
109109
curl -svX PUT --data-binary @infile3 "$URL" 2>curl_putExisting.out &&
110110
grep "HTTP/1.1 201 Created" curl_putExisting.out &&
111-
LOCATION=$(grep Location curl_putExisting.out) &&
112-
IPFS_HASH=$(grep Ipfs-Hash curl_putExisting.out) &&
113-
HASH=$(expr "$LOCATION" : "< Location: /ipfs/\(.*\)/test/test.txt") &&
114-
IPFS_HASH=$(expr "$IPFS_HASH" : "< Ipfs-Hash: \(\w*\)") &&
115-
[ "$HASH" = "$IPFS_HASH" ]
111+
LOCATION_HEADER=$(grep Location curl_putExisting.out) &&
112+
IPFS_HASH_HEADER=$(grep Ipfs-Hash curl_putExisting.out) &&
113+
HASH1=$(expr "$LOCATION_HEADER" : "< Location: /ipfs/\(.*\)/test/test.txt") &&
114+
HASH2=$(expr "$IPFS_HASH_HEADER" : "< Ipfs-Hash: \(\w*\)") &&
115+
[ "$HASH2" = "$HASH1" ]
116116
'
117117

118118
test_expect_success "We can HTTP GET file just replaced" '

0 commit comments

Comments
 (0)