aboutsummaryrefslogtreecommitdiffstats
path: root/t/test-lib-functions.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/test-lib-functions.sh')
-rw-r--r--t/test-lib-functions.sh12
1 files changed, 11 insertions, 1 deletions
diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh
index 78e054ab50..14d511f509 100644
--- a/t/test-lib-functions.sh
+++ b/t/test-lib-functions.sh
@@ -927,7 +927,7 @@ test_expect_success () {
test -n "$test_skip_test_preamble" ||
say >&3 "expecting success of $TEST_NUMBER.$test_count '$1': $test_body"
if test_run_ "$test_body" &&
- check_test_results_san_file_empty_
+ ! check_test_results_san_file_has_entries_
then
test_ok_ "$1"
else
@@ -1268,6 +1268,16 @@ test_cmp () {
eval "$GIT_TEST_CMP" '"$@"'
}
+# test_cmp_sorted runs test_cmp on sorted versions of the two
+# input files. Uses "$1.sorted" and "$2.sorted" as temp files.
+
+test_cmp_sorted () {
+ sort <"$1" >"$1.sorted" &&
+ sort <"$2" >"$2.sorted" &&
+ test_cmp "$1.sorted" "$2.sorted" &&
+ rm "$1.sorted" "$2.sorted"
+}
+
# Check that the given config key has the expected value.
#
# test_cmp_config [-C <dir>] <expected-value>