summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@suse.de>2010-02-21 00:37:01 +0100
committerAndreas Gruenbacher <agruen@suse.de>2010-02-21 00:37:40 +0100
commitd300ec9bb83c6bba6f957bf1a051879cb793e199 (patch)
tree387dfd475f91a7a31bda3ebf6118f770f98b0f77 /tests
parent70c5b3126f8320cbc7d7d9a565693fff33e70ac0 (diff)
downloadpatch-d300ec9bb83c6bba6f957bf1a051879cb793e199.tar.gz
Merge: detect already-applied inserts at the end of files
* src/merge.c: When a hunk has fewer suffix than prefix context lines, try matching to the end of the file instead of doing a "greedy match": this allows to detect already-applied inserts at the end of the file. * tests/merge: Add test cases for this.
Diffstat (limited to 'tests')
-rw-r--r--tests/merge30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/merge b/tests/merge
index 0a3c7ff..98c5705 100644
--- a/tests/merge
+++ b/tests/merge
@@ -166,6 +166,36 @@ a
4
EOF
+check 'x 2 1ia 1ib -- 1ia 1ib' <<EOF
+Hunk #1 already applied at 1-2.
+a
+b
+1
+2
+
+Hunk #1 already applied at 1-2.
+a
+b
+1
+2
+
+EOF
+
+check 'x 2 2aa 2ab -- 2aa 2ab' <<EOF
+Hunk #1 already applied at 3-4.
+1
+2
+a
+b
+
+Hunk #1 already applied at 3-4.
+1
+2
+a
+b
+
+EOF
+
# ==============================================================
check 'x 4 2d -- 3d' <<EOF