summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOzan Çağlayan <ozan@pardus.org.tr>2011-02-03 23:04:02 +0100
committerAndreas Gruenbacher <agruen@linbit.com>2011-02-04 00:10:28 +0100
commit3fc5b24073cbb0b650b7bfb4447101e424965c56 (patch)
treebcbe6130fbb3045b1c9089f7343236fb745a12bf
parent3c776b08449581b44afddeea68942531d2f047b2 (diff)
downloadpatch-3fc5b24073cbb0b650b7bfb4447101e424965c56.tar.gz
Create directory test case
* tests/create-delete: New test case creating a file in a new sub-directory (bug fixed on 2010-12-04).
-rw-r--r--ChangeLog6
-rw-r--r--tests/Makefile.am1
-rw-r--r--tests/create-directory27
3 files changed, 34 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index bfb0d3f..e72c82c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2011-02-03 Ozan Çağlayan <ozan@pardus.org.tr>
+
+ Create directory test case
+ * tests/create-delete: New test case creating a file in a new
+ sub-directory (bug fixed on 2010-12-04).
+
2011-02-03 Andreas Gruenbacher <agruen@linbit.com>
Also check if the input file is seekable if a filename is given (-i)
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 8559f24..de8862c 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -23,6 +23,7 @@ TESTS = \
copy-rename \
corrupt-reject-files \
create-delete \
+ create-directory \
criss-cross \
crlf-handling \
dash-o-append \
diff --git a/tests/create-directory b/tests/create-directory
new file mode 100644
index 0000000..7672766
--- /dev/null
+++ b/tests/create-directory
@@ -0,0 +1,27 @@
+# Copyright (C) 2010 Free Software Foundation, Inc.
+#
+# Copying and distribution of this file, with or without modification,
+# in any medium, are permitted without royalty provided the copyright
+# notice and this notice are preserved.
+
+# Check whether patch correctly creates directories before creating
+# new files.
+
+. $srcdir/test-lib.sh
+
+use_local_patch
+use_tmpdir
+
+# ==============================================================
+
+cat > f.diff <<EOF
+--- /dev/null
++++ b/newfile
+@@ -0,0 +1,2 @@
++one
++two
+EOF
+
+check 'patch -p0 < f.diff' <<EOF
+patching file b/newfile
+EOF