summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@suse.de>2010-09-17 13:35:58 +0200
committerAndreas Gruenbacher <agruen@suse.de>2010-09-17 13:35:58 +0200
commit86e12910c67ce69b5e36592824c053d900031e1e (patch)
tree2a6d2e853b106878dadc976bb17e96439c57b607
parent7e6d1e67182b79d4e0de4f6e1d7f70009c57590c (diff)
downloadpatch-86e12910c67ce69b5e36592824c053d900031e1e.tar.gz
Add copy-after-modify test case
* tests/criss-cross: Add copy-after-modify test case.
-rw-r--r--ChangeLog2
-rw-r--r--tests/criss-cross43
2 files changed, 45 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 40f3785..a560133 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -38,6 +38,8 @@
still.
* tests/criss-cross: Test case currently expected to fail.
+ * tests/criss-cross: Add copy-after-modify test case.
+
2010-07-27 Tim Waugh <twaugh@redhat.com>
* src/patch.c: Stops "patch --get 1" from segfaulting.
diff --git a/tests/criss-cross b/tests/criss-cross
index e3ff959..e5943c0 100644
--- a/tests/criss-cross
+++ b/tests/criss-cross
@@ -41,3 +41,46 @@ EOF
check 'cat g' <<EOF
1
EOF
+
+# ==============================================================
+# Copy-after-modify test case
+
+ncheck 'seq 1 1000 > a'
+
+cat > modified-twice.diff <<EOF
+diff --git a/a b/a
+index 1179824..912fcbd 100644
+--- a/a
++++ b/a
+@@ -998,3 +998,4 @@
+ 998
+ 999
+ 1000
++a
+diff --git a/a b/b
+similarity index 99%
+copy from a
+copy to b
+index 1179824..1c5afa7 100644
+--- a/a
++++ b/b
+@@ -998,3 +998,4 @@
+ 998
+ 999
+ 1000
++b
+EOF
+
+check 'patch -p1 < modified-twice.diff || echo "Status: $?"' <<EOF
+patching file a
+patching file b (copied from a)
+EOF
+
+check 'cat a' <<EOF
+`seq 1 1000`
+a
+EOF
+check 'cat b' <<EOF
+`seq 1 1000`
+b
+EOF