File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -952,7 +952,13 @@ test_expect_code () {
952
952
# - not all diff versions understand "-u"
953
953
954
954
test_cmp () {
955
- eval " $GIT_TEST_CMP " ' "$@"'
955
+ test $# -eq 2 || BUG " test_cmp requires two arguments"
956
+ if ! eval " $GIT_TEST_CMP " ' "$@"'
957
+ then
958
+ test " x$1 " = x- || test -e " $1 " || BUG " test_cmp '$1 ' missing"
959
+ test " x$2 " = x- || test -e " $2 " || BUG " test_cmp '$2 ' missing"
960
+ return 1
961
+ fi
956
962
}
957
963
958
964
# Check that the given config key has the expected value.
@@ -981,7 +987,13 @@ test_cmp_config() {
981
987
# test_cmp_bin - helper to compare binary files
982
988
983
989
test_cmp_bin () {
984
- cmp " $@ "
990
+ test $# -eq 2 || BUG " test_cmp_bin requires two arguments"
991
+ if ! cmp " $@ "
992
+ then
993
+ test " x$1 " = x- || test -e " $1 " || BUG " test_cmp_bin '$1 ' missing"
994
+ test " x$2 " = x- || test -e " $2 " || BUG " test_cmp_bin '$2 ' missing"
995
+ return 1
996
+ fi
985
997
}
986
998
987
999
# Use this instead of test_cmp to compare files that contain expected and
You can’t perform that action at this time.
0 commit comments