On Tue, Nov 25, 2014 at 04:34:25PM +0100, Tobias Stoeckmann wrote:

> Hi,
> 
> the regress tests for patch only cover unified diffs so far.  I guess
> nobody minds if I add 3 tests for:
> 
> - normal diff
> - context diff
> - ed diff

regress does not need oks, just add stuff if you think it makes sense
(it does, however). 
        
        -Otto
> 
> 
> Tobias
> 
> Index: Makefile
> ===================================================================
> RCS file: /cvs/src/regress/usr.bin/patch/Makefile,v
> retrieving revision 1.7
> diff -u -p -u -p -r1.7 Makefile
> --- Makefile  20 Aug 2008 18:29:37 -0000      1.7
> +++ Makefile  25 Nov 2014 15:17:35 -0000
> @@ -3,7 +3,7 @@
>  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 
>  
>  # 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 
>  # 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}
>  
> Index: t14.diff
> ===================================================================
> RCS file: t14.diff
> diff -N t14.diff
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ t14.diff  25 Nov 2014 15:17:35 -0000
> @@ -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
> Index: t14.in
> ===================================================================
> RCS file: t14.in
> diff -N t14.in
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ t14.in    25 Nov 2014 15:17:35 -0000
> @@ -0,0 +1,8 @@
> +line 0
> +line 1
> +line 2
> +line 3
> +line 4
> +line 5
> +line 6
> +line 7
> Index: t14.out
> ===================================================================
> RCS file: t14.out
> diff -N t14.out
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ t14.out   25 Nov 2014 15:17:35 -0000
> @@ -0,0 +1,6 @@
> +line 1
> +line between 1 and 2
> +line 2
> +adjusted line 3
> +adjusted line 4
> +line 5
> Index: t15.diff
> ===================================================================
> RCS file: t15.diff
> diff -N t15.diff
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ t15.diff  25 Nov 2014 15:17:35 -0000
> @@ -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
> Index: t15.in
> ===================================================================
> RCS file: t15.in
> diff -N t15.in
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ t15.in    25 Nov 2014 15:17:35 -0000
> @@ -0,0 +1,8 @@
> +line 0
> +line 1
> +line 2
> +line 3
> +line 4
> +line 5
> +line 6
> +line 7
> Index: t15.out
> ===================================================================
> RCS file: t15.out
> diff -N t15.out
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ t15.out   25 Nov 2014 15:17:35 -0000
> @@ -0,0 +1,6 @@
> +line 1
> +line between 1 and 2
> +line 2
> +adjusted line 3
> +adjusted line 4
> +line 5
> Index: t16.diff
> ===================================================================
> RCS file: t16.diff
> diff -N t16.diff
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ t16.diff  25 Nov 2014 15:17:35 -0000
> @@ -0,0 +1,9 @@
> +7,8d
> +4,5c
> +adjusted line 3
> +adjusted line 4
> +.
> +2a
> +line between 1 and 2
> +.
> +1d
> Index: t16.in
> ===================================================================
> RCS file: t16.in
> diff -N t16.in
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ t16.in    25 Nov 2014 15:17:35 -0000
> @@ -0,0 +1,8 @@
> +line 0
> +line 1
> +line 2
> +line 3
> +line 4
> +line 5
> +line 6
> +line 7
> Index: t16.out
> ===================================================================
> RCS file: t16.out
> diff -N t16.out
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ t16.out   25 Nov 2014 15:17:35 -0000
> @@ -0,0 +1,6 @@
> +line 1
> +line between 1 and 2
> +line 2
> +adjusted line 3
> +adjusted line 4
> +line 5

Reply via email to