]> git.notmuchmail.org Git - notmuch/blobdiff - test/test-lib.sh
test: make test_expect_equal_file() arguments flexible
[notmuch] / test / test-lib.sh
index 791d2dc668e05dde0a0c4e5828db1dea8988e2b6..663b18e69d05558fc624aef1cd4c5166977c240a 100644 (file)
@@ -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
 }