mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-22 02:48:08 +01:00
test: handle filenames that have directories in them
Since $TEST_DIRECTORY is an absolute path, any filenames generated with it will be complete paths. Only use the basename to generate suffixes for filenames. Signed-off-by: Ethan Glasser-Camp <ethan@betacantrips.com>
This commit is contained in:
parent
345faab1f5
commit
b52ee879d8
1 changed files with 5 additions and 3 deletions
|
@ -498,16 +498,18 @@ test_expect_equal_file ()
|
||||||
error "bug in the test script: not 2 or 3 parameters to test_expect_equal"
|
error "bug in the test script: not 2 or 3 parameters to test_expect_equal"
|
||||||
|
|
||||||
file1="$1"
|
file1="$1"
|
||||||
|
basename1=`basename "$file1"`
|
||||||
file2="$2"
|
file2="$2"
|
||||||
|
basename2=`basename "$file2"`
|
||||||
if ! test_skip "$test_subtest_name"
|
if ! test_skip "$test_subtest_name"
|
||||||
then
|
then
|
||||||
if diff -q "$file1" "$file2" >/dev/null ; then
|
if diff -q "$file1" "$file2" >/dev/null ; then
|
||||||
test_ok_ "$test_subtest_name"
|
test_ok_ "$test_subtest_name"
|
||||||
else
|
else
|
||||||
testname=$this_test.$test_count
|
testname=$this_test.$test_count
|
||||||
cp "$file1" "$testname.$file1"
|
cp "$file1" "$testname.$basename1"
|
||||||
cp "$file2" "$testname.$file2"
|
cp "$file2" "$testname.$basename2"
|
||||||
test_failure_ "$test_subtest_name" "$(diff -u "$testname.$file1" "$testname.$file2")"
|
test_failure_ "$test_subtest_name" "$(diff -u "$testname.$basename1" "$testname.$basename2")"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue