mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-24 03:48:10 +01:00
test: check for empty/missing files in test_expect_equal_message_body
Messages can have empty bodies, but empty files are not messages.
This commit is contained in:
parent
dfa43a1921
commit
f6fcdf12da
1 changed files with 8 additions and 0 deletions
|
@ -388,6 +388,14 @@ test_expect_equal_message_body () {
|
||||||
test "$#" = 2 ||
|
test "$#" = 2 ||
|
||||||
error "bug in the test script: not 2 parameters to test_expect_equal_file"
|
error "bug in the test script: not 2 parameters to test_expect_equal_file"
|
||||||
|
|
||||||
|
for file in "$1" "$2"; do
|
||||||
|
if [ ! -s "$file" ]; then
|
||||||
|
test_failure_ "Missing or zero length file: $file"
|
||||||
|
inside_subtest=
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
expected=$(sed '1,/^$/d' "$1")
|
expected=$(sed '1,/^$/d' "$1")
|
||||||
output=$(sed '1,/^$/d' "$2")
|
output=$(sed '1,/^$/d' "$2")
|
||||||
test_expect_equal "$expected" "$output"
|
test_expect_equal "$expected" "$output"
|
||||||
|
|
Loading…
Reference in a new issue