My Various Git Projects
/
git.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8104ec9
)
test functions: add function `test_file_not_empty`
author
Rohit Ashiwal
<rohit.ashiwal265@gmail.com>
Mon, 4 Mar 2019 12:07:59 +0000
(17:37 +0530)
committer
Junio C Hamano
<gitster@pobox.com>
Fri, 8 Mar 2019 05:21:27 +0000
(14:21 +0900)
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>
t/test-lib-functions.sh
patch
|
blob
|
history
diff --git
a/t/test-lib-functions.sh
b/t/test-lib-functions.sh
index
80402a4
..
681c41b
100644
(file)
--- a/
t/test-lib-functions.sh
+++ b/
t/test-lib-functions.sh
@@
-593,6
+593,15
@@
test_dir_is_empty () {
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 () {
if test -e "$1"
then