summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@linbit.com>2012-09-26 01:33:22 +0200
committerAndreas Gruenbacher <agruen@linbit.com>2012-09-26 01:33:22 +0200
commite8bfce654715e443830069b9dfa73e7300de0392 (patch)
tree1251e861a2f634c7fcca93dacbd125daea99ad87 /tests
parent1d9ed51e9c812d49affc2f9b3cd985257f6a525b (diff)
downloadpatch-e8bfce654715e443830069b9dfa73e7300de0392.tar.gz
Improve the previous commit
* src/patch.c: Only print the "file is not empty after patch" message when trying to delete the output file. Say that we were trying to delete the file. * tests/create-delete: Fix the expected messages. Add test cases for the --remove-empty-files and --posix options. * NEWS: Better describe this change.
Diffstat (limited to 'tests')
-rw-r--r--tests/create-delete26
1 files changed, 23 insertions, 3 deletions
diff --git a/tests/create-delete b/tests/create-delete
index 54dd920..654246d 100644
--- a/tests/create-delete
+++ b/tests/create-delete
@@ -182,7 +182,7 @@ EOF
check 'patch -p0 -b < p.diff || echo status: $?' <<EOF
patching file target
-File target is not empty after patch, as expected
+File target is not empty after patch; not deleting
status: 1
EOF
@@ -208,7 +208,7 @@ EOF
check 'patch -p0 < p.diff || echo status: $?' <<EOF
patching file target
-File target is not empty after patch, as expected
+File target is not empty after patch; not deleting
status: 1
EOF
@@ -227,7 +227,7 @@ EOF
check 'patch -p1 < p.diff || echo status: $?' <<EOF
patching file target
-File target is not empty after patch, as expected
+File target is not empty after patch; not deleting
status: 1
EOF
@@ -251,6 +251,13 @@ EOF
check 'cat target' <<EOF
EOF
+echo 1 > target
+check 'patch -p0 -E < p.diff || echo status: $?' <<EOF
+patching file target
+EOF
+
+ncheck 'test ! -e target'
+
# ================================================================
# File expected to become empty does become empty
@@ -274,3 +281,16 @@ ncheck 'test ! -e target'
check 'cat target.orig' <<EOF
data
EOF
+
+echo data > target
+
+check 'patch -p1 -b --posix -f < p.diff || echo status: $?' <<EOF
+patching file target
+EOF
+
+check 'cat target' <<EOF
+EOF
+
+check 'cat target.orig' <<EOF
+data
+EOF