diff options
author | Tobias Stoeckmann <tobias@cvs.openbsd.org> | 2014-11-25 16:01:09 +0000 |
---|---|---|
committer | Tobias Stoeckmann <tobias@cvs.openbsd.org> | 2014-11-25 16:01:09 +0000 |
commit | 306cdb4ba0d76c4b20a166c63baad67ad14d4df6 (patch) | |
tree | 6fd397bab5cf513c5e38ba1d16f81120c3dbb0de /regress | |
parent | e60e5593822d293ccb87a6a46d334c7cbe01be50 (diff) |
Also cover other diff formats besides unified ones.
ok otto
Diffstat (limited to 'regress')
-rw-r--r-- | regress/usr.bin/patch/Makefile | 9 | ||||
-rw-r--r-- | regress/usr.bin/patch/t14.diff | 13 | ||||
-rw-r--r-- | regress/usr.bin/patch/t14.in | 8 | ||||
-rw-r--r-- | regress/usr.bin/patch/t14.out | 6 | ||||
-rw-r--r-- | regress/usr.bin/patch/t15.diff | 19 | ||||
-rw-r--r-- | regress/usr.bin/patch/t15.in | 8 | ||||
-rw-r--r-- | regress/usr.bin/patch/t15.out | 6 | ||||
-rw-r--r-- | regress/usr.bin/patch/t16.diff | 9 | ||||
-rw-r--r-- | regress/usr.bin/patch/t16.in | 8 | ||||
-rw-r--r-- | regress/usr.bin/patch/t16.out | 6 |
10 files changed, 89 insertions, 3 deletions
diff --git a/regress/usr.bin/patch/Makefile b/regress/usr.bin/patch/Makefile index 3fc6a9c5e1d..f70f321a5dd 100644 --- a/regress/usr.bin/patch/Makefile +++ b/regress/usr.bin/patch/Makefile @@ -1,9 +1,9 @@ -# $OpenBSD: Makefile,v 1.7 2008/08/20 18:29:37 otto Exp $ +# $OpenBSD: Makefile,v 1.8 2014/11/25 16:01:08 tobias Exp $ PATCH=patch PATCHOPTIONS=-sN -REGRESS_TARGETS=t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 +REGRESS_TARGETS=t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 # .in: input file # .diff: patch @@ -11,7 +11,7 @@ REGRESS_TARGETS=t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 # 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. +# t3: a case where patch should detect a previously applied patch. # Diff transform an empty file into a single line one. Currently fails. # t4: a case where patch has to detect a previously applied patch. # Diff transform a file with a single line with an eol into a single @@ -20,6 +20,9 @@ REGRESS_TARGETS=t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 # 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. +# t14: diff in normal diff format. +# t15: diff in context diff format. +# t16: diff in ed format. all: clean ${REGRESS_TARGET} diff --git a/regress/usr.bin/patch/t14.diff b/regress/usr.bin/patch/t14.diff new file mode 100644 index 00000000000..7b0e778165c --- /dev/null +++ b/regress/usr.bin/patch/t14.diff @@ -0,0 +1,13 @@ +1d0 +< line 0 +2a2 +> line between 1 and 2 +4,5c4,5 +< line 3 +< line 4 +--- +> adjusted line 3 +> adjusted line 4 +7,8d6 +< line 6 +< line 7 diff --git a/regress/usr.bin/patch/t14.in b/regress/usr.bin/patch/t14.in new file mode 100644 index 00000000000..ea395f09f34 --- /dev/null +++ b/regress/usr.bin/patch/t14.in @@ -0,0 +1,8 @@ +line 0 +line 1 +line 2 +line 3 +line 4 +line 5 +line 6 +line 7 diff --git a/regress/usr.bin/patch/t14.out b/regress/usr.bin/patch/t14.out new file mode 100644 index 00000000000..991f42c58e6 --- /dev/null +++ b/regress/usr.bin/patch/t14.out @@ -0,0 +1,6 @@ +line 1 +line between 1 and 2 +line 2 +adjusted line 3 +adjusted line 4 +line 5 diff --git a/regress/usr.bin/patch/t15.diff b/regress/usr.bin/patch/t15.diff new file mode 100644 index 00000000000..e7634d095aa --- /dev/null +++ b/regress/usr.bin/patch/t15.diff @@ -0,0 +1,19 @@ +*** t15.orig Tue Nov 25 15:33:48 2014 +--- t15.in Tue Nov 25 15:33:56 2014 +*************** +*** 1,8 **** +- line 0 + line 1 + line 2 +! line 3 +! line 4 + line 5 +- line 6 +- line 7 +--- 1,6 ---- + line 1 ++ line between 1 and 2 + line 2 +! adjusted line 3 +! adjusted line 4 + line 5 diff --git a/regress/usr.bin/patch/t15.in b/regress/usr.bin/patch/t15.in new file mode 100644 index 00000000000..ea395f09f34 --- /dev/null +++ b/regress/usr.bin/patch/t15.in @@ -0,0 +1,8 @@ +line 0 +line 1 +line 2 +line 3 +line 4 +line 5 +line 6 +line 7 diff --git a/regress/usr.bin/patch/t15.out b/regress/usr.bin/patch/t15.out new file mode 100644 index 00000000000..991f42c58e6 --- /dev/null +++ b/regress/usr.bin/patch/t15.out @@ -0,0 +1,6 @@ +line 1 +line between 1 and 2 +line 2 +adjusted line 3 +adjusted line 4 +line 5 diff --git a/regress/usr.bin/patch/t16.diff b/regress/usr.bin/patch/t16.diff new file mode 100644 index 00000000000..875a65a2090 --- /dev/null +++ b/regress/usr.bin/patch/t16.diff @@ -0,0 +1,9 @@ +7,8d +4,5c +adjusted line 3 +adjusted line 4 +. +2a +line between 1 and 2 +. +1d diff --git a/regress/usr.bin/patch/t16.in b/regress/usr.bin/patch/t16.in new file mode 100644 index 00000000000..ea395f09f34 --- /dev/null +++ b/regress/usr.bin/patch/t16.in @@ -0,0 +1,8 @@ +line 0 +line 1 +line 2 +line 3 +line 4 +line 5 +line 6 +line 7 diff --git a/regress/usr.bin/patch/t16.out b/regress/usr.bin/patch/t16.out new file mode 100644 index 00000000000..991f42c58e6 --- /dev/null +++ b/regress/usr.bin/patch/t16.out @@ -0,0 +1,6 @@ +line 1 +line between 1 and 2 +line 2 +adjusted line 3 +adjusted line 4 +line 5 |