提交 7d80512a 作者: Christian Couder 提交者: Jeromy

test-lib: add test_path_cmp()

License: MIT
Signed-off-by: 's avatarChristian Couder <chriscool@tuxfamily.org>
上级 ea8d8aaa
......@@ -23,6 +23,14 @@ test_sort_cmp() {
test_cmp "$1_sorted" "$2_sorted"
}
# Same as test_cmp above, but we standardize directory
# separators before comparing the files.
test_path_cmp() {
sed -e "s/\\\\/\//g" "$1" >"$1_std" &&
sed -e "s/\\\\/\//g" "$2" >"$2_std" &&
test_cmp "$1_std" "$2_std"
}
# Quote arguments for sh eval
shellquote() {
_space=''
......
......@@ -39,7 +39,7 @@ test_expect_success "ipfs cat fails" '
test_expect_success "ipfs cat no repo message looks good" '
echo "Error: no ipfs repo found in $IPFS_PATH." > cat_fail_exp &&
echo "please run: ipfs init" >> cat_fail_exp &&
test_cmp cat_fail_exp cat_fail_out
test_path_cmp cat_fail_exp cat_fail_out
'
# test that init succeeds
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论