mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-26 23:53:19 +08:00
sharness: Use sed in a cross-platform safe way
OS X sed is documented as "-i SUFFIX", GNU sed as "-iSUFFIX". The one consistent case seems to be "-iSUFFIX", where suffix cannot empty (or OS X will parse the next argument as the suffix). This used to leave around files named `refsout=` on Linux, and was just confusing. License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com>
This commit is contained in:
@ -138,7 +138,7 @@ test_expect_success "adding multiblock random file succeeds" '
|
|||||||
test_expect_success "'ipfs pin ls --type=indirect' is correct" '
|
test_expect_success "'ipfs pin ls --type=indirect' is correct" '
|
||||||
ipfs refs "$MBLOCKHASH" >refsout &&
|
ipfs refs "$MBLOCKHASH" >refsout &&
|
||||||
ipfs refs -r "$HASH_WELCOME_DOCS" >>refsout &&
|
ipfs refs -r "$HASH_WELCOME_DOCS" >>refsout &&
|
||||||
sed -i="" "s/\(.*\)/\1 indirect/g" refsout &&
|
sed -i"~" "s/\(.*\)/\1 indirect/g" refsout &&
|
||||||
ipfs pin ls --type=indirect >indirectpins &&
|
ipfs pin ls --type=indirect >indirectpins &&
|
||||||
test_sort_cmp refsout indirectpins
|
test_sort_cmp refsout indirectpins
|
||||||
'
|
'
|
||||||
@ -166,7 +166,7 @@ test_expect_success "'ipfs pin ls --type=recursive' is correct" '
|
|||||||
echo "$HASH_WELCOME_DOCS" >>rp_expected &&
|
echo "$HASH_WELCOME_DOCS" >>rp_expected &&
|
||||||
echo "$EMPTY_DIR" >>rp_expected &&
|
echo "$EMPTY_DIR" >>rp_expected &&
|
||||||
ipfs refs -r "$HASH_WELCOME_DOCS" >>rp_expected &&
|
ipfs refs -r "$HASH_WELCOME_DOCS" >>rp_expected &&
|
||||||
sed -i="" "s/\(.*\)/\1 recursive/g" rp_expected &&
|
sed -i"~" "s/\(.*\)/\1 recursive/g" rp_expected &&
|
||||||
ipfs pin ls --type=recursive >rp_actual &&
|
ipfs pin ls --type=recursive >rp_actual &&
|
||||||
test_sort_cmp rp_expected rp_actual
|
test_sort_cmp rp_expected rp_actual
|
||||||
'
|
'
|
||||||
|
Reference in New Issue
Block a user