summaryrefslogtreecommitdiff
path: root/regress/usr.bin/patch
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2004-06-20 19:25:24 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2004-06-20 19:25:24 +0000
commitbf27ea17905971e9da7d71260e1894f3542629ca (patch)
treee270866c0bf1374da654aa2ad961d50851ba2384 /regress/usr.bin/patch
parent37ebb6b9bbb5b8afd9a257272d1c419a724485ba (diff)
Some more regressions, mostly involving no eol at end of file. t4
and t13 currenlty fail, but this will be fixed real soon now.
Diffstat (limited to 'regress/usr.bin/patch')
-rw-r--r--regress/usr.bin/patch/Makefile19
-rw-r--r--regress/usr.bin/patch/t10.diff7
-rw-r--r--regress/usr.bin/patch/t10.in3
-rw-r--r--regress/usr.bin/patch/t10.out2
-rw-r--r--regress/usr.bin/patch/t11.diff6
-rw-r--r--regress/usr.bin/patch/t11.in3
-rw-r--r--regress/usr.bin/patch/t11.out2
-rw-r--r--regress/usr.bin/patch/t12.diff6
-rw-r--r--regress/usr.bin/patch/t12.in2
-rw-r--r--regress/usr.bin/patch/t12.out1
-rw-r--r--regress/usr.bin/patch/t13.diff9
-rw-r--r--regress/usr.bin/patch/t13.in4
-rw-r--r--regress/usr.bin/patch/t13.out4
-rw-r--r--regress/usr.bin/patch/t6.diff6
-rw-r--r--regress/usr.bin/patch/t6.in1
-rw-r--r--regress/usr.bin/patch/t6.out1
-rw-r--r--regress/usr.bin/patch/t7.diff7
-rw-r--r--regress/usr.bin/patch/t7.in1
-rw-r--r--regress/usr.bin/patch/t7.out1
-rw-r--r--regress/usr.bin/patch/t8.diff9
-rw-r--r--regress/usr.bin/patch/t8.in4
-rw-r--r--regress/usr.bin/patch/t8.out4
-rw-r--r--regress/usr.bin/patch/t9.diff8
-rw-r--r--regress/usr.bin/patch/t9.in2
-rw-r--r--regress/usr.bin/patch/t9.out3
25 files changed, 110 insertions, 5 deletions
diff --git a/regress/usr.bin/patch/Makefile b/regress/usr.bin/patch/Makefile
index 5c2f9e263df..2af317baefa 100644
--- a/regress/usr.bin/patch/Makefile
+++ b/regress/usr.bin/patch/Makefile
@@ -1,9 +1,9 @@
-# $OpenBSD: Makefile,v 1.5 2004/06/14 18:40:23 otto Exp $
+# $OpenBSD: Makefile,v 1.6 2004/06/20 19:25:23 otto Exp $
PATCH=patch
PATCHOPTIONS=-sN
-REGRESS_TARGETS=t1 t2 t3 t4 t5
+REGRESS_TARGETS=t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13
# .in: input file
# .diff: patch
@@ -14,10 +14,12 @@ REGRESS_TARGETS=t1 t2 t3 t4 t5
# t3: a case where it patch should detect a previously applied patch.
# Diff transform an empty file into a single line one.
# t4: a case where patch has to detect a previously applied patch.
-# Diff transform an file with a single line without eol into a single
-# line with eol. Fails because patch does not detect the previously
-# applied diff.
+# Diff transform a file with a single line with an eol into a single
+# line without eol.
# t5: both files in diff do not exist. t5.in should be missing.
+# t6-t12: various cases of no eol at end of file handling.
+# t13: a case where patch has to detect a previously applied patch.
+# Diff transform a file ending with no eol into a file ending with eol.
all: clean ${REGRESS_TARGET}
@@ -49,6 +51,13 @@ t5:
@${PATCH} ${PATCHOPTIONS} < ${.CURDIR}/${*}.diff
@cmp -s ${*} ${.CURDIR}/${*}.out || (echo "XXX ${*} failed" && false)
+t13:
+ @echo ${*}
+ @cp ${.CURDIR}/${*}.in ${*}.copy
+ @(! ${PATCH} ${PATCHOPTIONS} ${*}.copy ${.CURDIR}/${*}.diff)
+ @cmp -s ${*}.copy ${.CURDIR}/${*}.out || \
+ (echo "XXX ${*} failed" && false)
+
# Clean all files generated
clean:
rm -f *.copy *.orig *.rej t5
diff --git a/regress/usr.bin/patch/t10.diff b/regress/usr.bin/patch/t10.diff
new file mode 100644
index 00000000000..bd2dbcc8dd2
--- /dev/null
+++ b/regress/usr.bin/patch/t10.diff
@@ -0,0 +1,7 @@
+--- t10.in Sat Jun 19 13:31:32 2004
++++ t10.out Sat Jun 19 13:31:34 2004
+@@ -1,3 +1,2 @@
+
+-
+ a
+\ No newline at end of file
diff --git a/regress/usr.bin/patch/t10.in b/regress/usr.bin/patch/t10.in
new file mode 100644
index 00000000000..82e3debc502
--- /dev/null
+++ b/regress/usr.bin/patch/t10.in
@@ -0,0 +1,3 @@
+
+
+a \ No newline at end of file
diff --git a/regress/usr.bin/patch/t10.out b/regress/usr.bin/patch/t10.out
new file mode 100644
index 00000000000..9fe188c32cd
--- /dev/null
+++ b/regress/usr.bin/patch/t10.out
@@ -0,0 +1,2 @@
+
+a \ No newline at end of file
diff --git a/regress/usr.bin/patch/t11.diff b/regress/usr.bin/patch/t11.diff
new file mode 100644
index 00000000000..6803451c931
--- /dev/null
+++ b/regress/usr.bin/patch/t11.diff
@@ -0,0 +1,6 @@
+--- t11.in Sat Jun 19 13:34:21 2004
++++ t11.out Sat Jun 19 13:34:29 2004
+@@ -1,3 +1,2 @@
+
+-
+ a
diff --git a/regress/usr.bin/patch/t11.in b/regress/usr.bin/patch/t11.in
new file mode 100644
index 00000000000..d3f21bac7fd
--- /dev/null
+++ b/regress/usr.bin/patch/t11.in
@@ -0,0 +1,3 @@
+
+
+a
diff --git a/regress/usr.bin/patch/t11.out b/regress/usr.bin/patch/t11.out
new file mode 100644
index 00000000000..6b673e88438
--- /dev/null
+++ b/regress/usr.bin/patch/t11.out
@@ -0,0 +1,2 @@
+
+a
diff --git a/regress/usr.bin/patch/t12.diff b/regress/usr.bin/patch/t12.diff
new file mode 100644
index 00000000000..966f4adc6e3
--- /dev/null
+++ b/regress/usr.bin/patch/t12.diff
@@ -0,0 +1,6 @@
+--- t12.in Sat Jun 19 19:48:40 2004
++++ t12.out Sat Jun 19 13:54:54 2004
+@@ -1,2 +1 @@
+-A line
+ 012345678
+\ No newline at end of file
diff --git a/regress/usr.bin/patch/t12.in b/regress/usr.bin/patch/t12.in
new file mode 100644
index 00000000000..3c0d5acdb2f
--- /dev/null
+++ b/regress/usr.bin/patch/t12.in
@@ -0,0 +1,2 @@
+A line
+012345678 \ No newline at end of file
diff --git a/regress/usr.bin/patch/t12.out b/regress/usr.bin/patch/t12.out
new file mode 100644
index 00000000000..3a332e6bba3
--- /dev/null
+++ b/regress/usr.bin/patch/t12.out
@@ -0,0 +1 @@
+012345678 \ No newline at end of file
diff --git a/regress/usr.bin/patch/t13.diff b/regress/usr.bin/patch/t13.diff
new file mode 100644
index 00000000000..183f011de44
--- /dev/null
+++ b/regress/usr.bin/patch/t13.diff
@@ -0,0 +1,9 @@
+--- t13.in Sat Jun 19 19:53:25 2004
++++ t13.out Sat Jun 19 19:53:40 2004
+@@ -1,4 +1,4 @@
+ A line of text 1
+ A line of text 2
+ A line of text 3
+-A line of text 4
+\ No newline at end of file
++A line of text 4
diff --git a/regress/usr.bin/patch/t13.in b/regress/usr.bin/patch/t13.in
new file mode 100644
index 00000000000..a354dc958e5
--- /dev/null
+++ b/regress/usr.bin/patch/t13.in
@@ -0,0 +1,4 @@
+A line of text 1
+A line of text 2
+A line of text 3
+A line of text 4
diff --git a/regress/usr.bin/patch/t13.out b/regress/usr.bin/patch/t13.out
new file mode 100644
index 00000000000..a354dc958e5
--- /dev/null
+++ b/regress/usr.bin/patch/t13.out
@@ -0,0 +1,4 @@
+A line of text 1
+A line of text 2
+A line of text 3
+A line of text 4
diff --git a/regress/usr.bin/patch/t6.diff b/regress/usr.bin/patch/t6.diff
new file mode 100644
index 00000000000..e8a3fa8d96f
--- /dev/null
+++ b/regress/usr.bin/patch/t6.diff
@@ -0,0 +1,6 @@
+--- t6.in Sat Jun 19 14:22:27 2004
++++ t6.out Sat Jun 19 12:57:07 2004
+@@ -1 +1 @@
+-A line of text
+\ No newline at end of file
++A line of text
diff --git a/regress/usr.bin/patch/t6.in b/regress/usr.bin/patch/t6.in
new file mode 100644
index 00000000000..c585375388e
--- /dev/null
+++ b/regress/usr.bin/patch/t6.in
@@ -0,0 +1 @@
+A line of text \ No newline at end of file
diff --git a/regress/usr.bin/patch/t6.out b/regress/usr.bin/patch/t6.out
new file mode 100644
index 00000000000..0f24bc045a8
--- /dev/null
+++ b/regress/usr.bin/patch/t6.out
@@ -0,0 +1 @@
+A line of text
diff --git a/regress/usr.bin/patch/t7.diff b/regress/usr.bin/patch/t7.diff
new file mode 100644
index 00000000000..c4cae106c63
--- /dev/null
+++ b/regress/usr.bin/patch/t7.diff
@@ -0,0 +1,7 @@
+--- t7.in Sat Jun 19 12:59:35 2004
++++ t7.out Sat Jun 19 12:59:47 2004
+@@ -1 +1 @@
+-A line of text with no eol
+\ No newline at end of file
++A line of text with no eol and a change
+\ No newline at end of file
diff --git a/regress/usr.bin/patch/t7.in b/regress/usr.bin/patch/t7.in
new file mode 100644
index 00000000000..77203f01f81
--- /dev/null
+++ b/regress/usr.bin/patch/t7.in
@@ -0,0 +1 @@
+A line of text with no eol \ No newline at end of file
diff --git a/regress/usr.bin/patch/t7.out b/regress/usr.bin/patch/t7.out
new file mode 100644
index 00000000000..b42df8e34b1
--- /dev/null
+++ b/regress/usr.bin/patch/t7.out
@@ -0,0 +1 @@
+A line of text with no eol and a change \ No newline at end of file
diff --git a/regress/usr.bin/patch/t8.diff b/regress/usr.bin/patch/t8.diff
new file mode 100644
index 00000000000..2be751354fc
--- /dev/null
+++ b/regress/usr.bin/patch/t8.diff
@@ -0,0 +1,9 @@
+--- t8.in Sat Jun 19 13:01:41 2004
++++ t8.out Sat Jun 19 13:01:46 2004
+@@ -1,4 +1,4 @@
+-Line 1
++Line 1 with a change
+ Line 2
+ Line 3
+ Line 4 (no eol)
+\ No newline at end of file
diff --git a/regress/usr.bin/patch/t8.in b/regress/usr.bin/patch/t8.in
new file mode 100644
index 00000000000..1dd730e3c12
--- /dev/null
+++ b/regress/usr.bin/patch/t8.in
@@ -0,0 +1,4 @@
+Line 1
+Line 2
+Line 3
+Line 4 (no eol) \ No newline at end of file
diff --git a/regress/usr.bin/patch/t8.out b/regress/usr.bin/patch/t8.out
new file mode 100644
index 00000000000..6d8b9c361de
--- /dev/null
+++ b/regress/usr.bin/patch/t8.out
@@ -0,0 +1,4 @@
+Line 1 with a change
+Line 2
+Line 3
+Line 4 (no eol) \ No newline at end of file
diff --git a/regress/usr.bin/patch/t9.diff b/regress/usr.bin/patch/t9.diff
new file mode 100644
index 00000000000..acd022daaf9
--- /dev/null
+++ b/regress/usr.bin/patch/t9.diff
@@ -0,0 +1,8 @@
+--- t9.in Sat Jun 19 13:03:57 2004
++++ t9.out Sat Jun 19 13:05:43 2004
+@@ -1,2 +1,3 @@
+ A line of text
+-
++Another
++x
+\ No newline at end of file
diff --git a/regress/usr.bin/patch/t9.in b/regress/usr.bin/patch/t9.in
new file mode 100644
index 00000000000..f20b8980543
--- /dev/null
+++ b/regress/usr.bin/patch/t9.in
@@ -0,0 +1,2 @@
+A line of text
+
diff --git a/regress/usr.bin/patch/t9.out b/regress/usr.bin/patch/t9.out
new file mode 100644
index 00000000000..5bab938eb2a
--- /dev/null
+++ b/regress/usr.bin/patch/t9.out
@@ -0,0 +1,3 @@
+A line of text
+Another
+x \ No newline at end of file