summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@gnu.org>2015-07-20 11:10:52 +0200
committerAndreas Gruenbacher <agruen@gnu.org>2015-07-20 11:18:12 +0200
commit98b86e970a3bc9c893a5d8344dd4f46070f1d236 (patch)
treedcdac9a3422089a976945a1fd8829c2c8f726982
parent68049159f2dcb9ba99c02acdd4740658bc005a2f (diff)
downloadpatch-98b86e970a3bc9c893a5d8344dd4f46070f1d236.tar.gz
Input file outside current directory: add test case
Patch currently makes sure that input / output files are inside the current working directory even when the input files are explicitly specified on the command line (see http://savannah.gnu.org/bugs/?45581). * tests/inname: Add a test case for this bug.
-rw-r--r--tests/inname20
1 files changed, 18 insertions, 2 deletions
diff --git a/tests/inname b/tests/inname
index b5ec9f3..fc45278 100644
--- a/tests/inname
+++ b/tests/inname
@@ -4,8 +4,6 @@
# in any medium, are permitted without royalty provided the copyright
# notice and this notice are preserved.
-# Don't recognize hunks before a filename has been specified/seen
-
. $srcdir/test-lib.sh
require cat
@@ -37,3 +35,21 @@ EOF
check 'cat x' <<EOF
three
EOF
+
+# --------------------------------------------------------------
+
+echo aa > file1
+
+mkdir 1
+cd 1
+cat > g.diff <<EOF
+--- file1
++++ file2
+@@ -1 +1 @@
+-aa
++bb
+EOF
+
+check 'patch ../file1 < g.diff' <<EOF
+patching file ../file
+EOF