test functions: add function `test_file_not_empty`
Add a helper function to ensure that a given path is a non-empty file, and give an error message when it is not. Signed-off-by: Rohit Ashiwal <rohit.ashiwal265@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>maint
parent
8104ec994e
commit
21d5ad9110
|
@ -593,6 +593,15 @@ test_dir_is_empty () {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Check if the file exists and has a size greater than zero
|
||||||
|
test_file_not_empty () {
|
||||||
|
if ! test -s "$1"
|
||||||
|
then
|
||||||
|
echo "'$1' is not a non-empty file."
|
||||||
|
false
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
test_path_is_missing () {
|
test_path_is_missing () {
|
||||||
if test -e "$1"
|
if test -e "$1"
|
||||||
then
|
then
|
||||||
|
|
Loading…
Reference in New Issue