aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--test/README10
-rw-r--r--test/test-lib.sh12
2 files changed, 11 insertions, 11 deletions
diff --git a/test/README b/test/README
index 43656a35..e0364e86 100644
--- a/test/README
+++ b/test/README
@@ -176,12 +176,12 @@ library for your script to use.
will generate a failure and print the difference of the two
strings.
- test_expect_equal_file <output> <expected>
+ test_expect_equal_file <file1> <file2>
- Identical to test_exepect_equal, except that <output> and
- <expected> are files instead of strings. This is a much more
- robust method to compare formatted textual information, since it
- also notices whitespace and closing newline differences.
+ Identical to test_exepect_equal, except that <file1> and <file2>
+ are files instead of strings. This is a much more robust method to
+ compare formatted textual information, since it also notices
+ whitespace and closing newline differences.
test_debug <script>
diff --git a/test/test-lib.sh b/test/test-lib.sh
index 791d2dc6..663b18e6 100644
--- a/test/test-lib.sh
+++ b/test/test-lib.sh
@@ -497,17 +497,17 @@ test_expect_equal_file ()
test "$#" = 2 ||
error "bug in the test script: not 2 or 3 parameters to test_expect_equal"
- output="$1"
- expected="$2"
+ file1="$1"
+ file2="$2"
if ! test_skip "$test_subtest_name"
then
- if diff -q "$expected" "$output" >/dev/null ; then
+ if diff -q "$file1" "$file2" >/dev/null ; then
test_ok_ "$test_subtest_name"
else
testname=$this_test.$test_count
- cp "$output" $testname.output
- cp "$expected" $testname.expected
- test_failure_ "$test_subtest_name" "$(diff -u $testname.expected $testname.output)"
+ cp "$file1" "$testname.$file1"
+ cp "$file2" "$testname.$file2"
+ test_failure_ "$test_subtest_name" "$(diff -u "$testname.$file1" "$testname.$file2")"
fi
fi
}