summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorotto <otto@openbsd.org>2004-06-14 18:40:23 +0000
committerotto <otto@openbsd.org>2004-06-14 18:40:23 +0000
commit32e0cdda526236ca8b520f9f47e26f9eb4866054 (patch)
tree6544341f229b3b0541e029b5aedbba27c6fafe50
parentTeach patch(1) to detect if a diff creating a file (or one adding (diff)
downloadwireguard-openbsd-32e0cdda526236ca8b520f9f47e26f9eb4866054.tar.xz
wireguard-openbsd-32e0cdda526236ca8b520f9f47e26f9eb4866054.zip
Correct test case 3 now that patch(1) is a bit smarter about empty files.
-rw-r--r--regress/usr.bin/patch/Makefile11
-rw-r--r--regress/usr.bin/patch/t3.out1
2 files changed, 8 insertions, 4 deletions
diff --git a/regress/usr.bin/patch/Makefile b/regress/usr.bin/patch/Makefile
index 604a4aef5eb..5c2f9e263df 100644
--- a/regress/usr.bin/patch/Makefile
+++ b/regress/usr.bin/patch/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.4 2003/09/02 16:33:33 david Exp $
+# $OpenBSD: Makefile,v 1.5 2004/06/14 18:40:23 otto Exp $
PATCH=patch
PATCHOPTIONS=-sN
@@ -12,8 +12,7 @@ REGRESS_TARGETS=t1 t2 t3 t4 t5
# t1: diff contains invalid line number 0.
# t2: diff contains invalid line numbers beyond end of input file.
# t3: a case where it patch should detect a previously applied patch.
-# Diff transform an empty file into a single line one. Patch cannot
-# detect this because it has an empty context.
+# 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
@@ -31,6 +30,12 @@ all: clean ${REGRESS_TARGET}
@cmp -s ${*}.copy ${.CURDIR}/${*}.out || \
(echo "XXX ${*} failed" && false)
+t3:
+ @echo ${*}
+ @cp ${.CURDIR}/${*}.in ${*}.copy
+ @(! ${PATCH} ${PATCHOPTIONS} ${*}.copy ${.CURDIR}/${*}.diff)
+ @cmp -s ${*}.copy ${.CURDIR}/${*}.out || \
+ (echo "XXX ${*} failed" && false)
t4:
@echo ${*}
@cp ${.CURDIR}/${*}.in ${*}.copy
diff --git a/regress/usr.bin/patch/t3.out b/regress/usr.bin/patch/t3.out
index c9ffc909a19..0f24bc045a8 100644
--- a/regress/usr.bin/patch/t3.out
+++ b/regress/usr.bin/patch/t3.out
@@ -1,2 +1 @@
A line of text
-A line of text