Date: Tue, 13 Feb 2024 15:14:48 +0000 (UTC) From: Pedro Giffuni <pfg@freebsd.org> To: "src-committers@freebsd.org" <src-committers@freebsd.org>, "dev-commits-src-all@freebsd.org" <dev-commits-src-all@freebsd.org>, =?UTF-8?Q?Dag-Erling_Sm=C3=B8rgrav?= <des@FreeBSD.org> Subject: Re: git: 851a9da38f07 - main - patch: Support long context lines. Message-ID: <1620767053.1846857.1707837288566@mail.yahoo.com> In-Reply-To: <202402121826.41CIQUk5080390@gitrepo.freebsd.org> References: <202402121826.41CIQUk5080390@gitrepo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
------=_Part_1846856_2104703329.1707837288562 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable FWIW ... We were already supporting very long lines. There was a thread like ages ag= o about not making them unnecessarily longer. But I doubt anyone cares about that anymore ;). Pedro. On Monday, February 12, 2024 at 01:26:38 PM GMT-5, Dag-Erling Sm=C3=B8r= grav <des@freebsd.org> wrote: =20 =20 The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=3D851a9da38f070675c42a6d69c41c= 47a5d29ee3d0 commit 851a9da38f070675c42a6d69c41c47a5d29ee3d0 Author:=C2=A0 =C2=A0 Dag-Erling Sm=C3=B8rgrav <des@FreeBSD.org> AuthorDate: 2024-02-12 18:26:13 +0000 Commit:=C2=A0 =C2=A0 Dag-Erling Sm=C3=B8rgrav <des@FreeBSD.org> CommitDate: 2024-02-12 18:26:13 +0000 =C2=A0 =C2=A0 patch: Support long context lines. =C2=A0 =C2=A0=20 =C2=A0 =C2=A0 MFC after:=C2=A0 =C2=A0 =C2=A0 1 week =C2=A0 =C2=A0 Sponsored by:=C2=A0 Klara, Inc. =C2=A0 =C2=A0 Reviewed by:=C2=A0 =C2=A0 allanjude =C2=A0 =C2=A0 Differential Revision:=C2=A0 https://reviews.freebsd.org/D438= 50 --- usr.bin/patch/patch.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 |=C2=A0 2 +- usr.bin/patch/pch.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 | 10 +++++----- usr.bin/patch/pch.h=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 |=C2=A0 2 +- usr.bin/patch/tests/unified_patch_test.sh | 19 +++++++++++++++++++ 4 files changed, 26 insertions(+), 7 deletions(-) diff --git a/usr.bin/patch/patch.c b/usr.bin/patch/patch.c index 403189bc92b1..838c721841ea 100644 --- a/usr.bin/patch/patch.c +++ b/usr.bin/patch/patch.c @@ -1085,7 +1085,7 @@ patch_match(LINENUM base, LINENUM offset, LINENUM fuz= z) =C2=A0=C2=A0=C2=A0 LINENUM=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 pat_lines = =3D pch_ptrn_lines() - fuzz; =C2=A0=C2=A0=C2=A0 const char=C2=A0=C2=A0=C2=A0 *ilineptr; =C2=A0=C2=A0=C2=A0 const char=C2=A0=C2=A0=C2=A0 *plineptr; -=C2=A0=C2=A0=C2=A0 unsigned short=C2=A0=C2=A0=C2=A0 plinelen; +=C2=A0=C2=A0=C2=A0 size_t=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 plinelen; =20 =C2=A0=C2=A0=C2=A0 /* Patch does not match if we don't have any more conte= xt to use */ =C2=A0=C2=A0=C2=A0 if (pline > pat_lines) diff --git a/usr.bin/patch/pch.c b/usr.bin/patch/pch.c index d528f06235bf..fb53ff86f9ef 100644 --- a/usr.bin/patch/pch.c +++ b/usr.bin/patch/pch.c @@ -55,7 +55,7 @@ static LINENUM=C2=A0=C2=A0=C2=A0 p_max;=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 /* max allowed value of p_end */ static LINENUM=C2=A0=C2=A0=C2=A0 p_context =3D 3;=C2=A0=C2=A0=C2=A0 /* # o= f context lines */ static LINENUM=C2=A0=C2=A0=C2=A0 p_input_line =3D 0;=C2=A0=C2=A0=C2=A0 /* = current line # from patch file */ static char=C2=A0=C2=A0=C2=A0 **p_line =3D NULL;/* the text of the hunk */ -static unsigned short=C2=A0=C2=A0=C2=A0 *p_len =3D NULL; /* length of each= line */ +static size_t=C2=A0=C2=A0=C2=A0 *p_len =3D NULL;=C2=A0=C2=A0=C2=A0 /* leng= th of each line */ static char=C2=A0=C2=A0=C2=A0 *p_char =3D NULL;=C2=A0=C2=A0=C2=A0 /* +, -,= and ! */ static int=C2=A0=C2=A0=C2=A0 hunkmax =3D INITHUNKMAX;=C2=A0=C2=A0=C2=A0 /*= size of above arrays to begin with */ static int=C2=A0=C2=A0=C2=A0 p_indent;=C2=A0=C2=A0=C2=A0 /* indent to patc= h */ @@ -137,7 +137,7 @@ set_hunkmax(void) =C2=A0=C2=A0=C2=A0 if (p_line =3D=3D NULL) =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 p_line =3D malloc(hunkmax * sizeof(c= har *)); =C2=A0=C2=A0=C2=A0 if (p_len =3D=3D NULL) -=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 p_len =3D malloc(hunkmax * sizeof(un= signed short)); +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 p_len =3D malloc(hunkmax * sizeof(si= ze_t)); =C2=A0=C2=A0=C2=A0 if (p_char =3D=3D NULL) =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 p_char =3D malloc(hunkmax * sizeof(c= har)); } @@ -154,7 +154,7 @@ grow_hunkmax(void) =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 fatal("Internal memory allocation er= ror\n"); =20 =C2=A0=C2=A0=C2=A0 p_line =3D reallocf(p_line, new_hunkmax * sizeof(char *= )); -=C2=A0=C2=A0=C2=A0 p_len =3D reallocf(p_len, new_hunkmax * sizeof(unsigned= short)); +=C2=A0=C2=A0=C2=A0 p_len =3D reallocf(p_len, new_hunkmax * sizeof(size_t))= ; =C2=A0=C2=A0=C2=A0 p_char =3D reallocf(p_char, new_hunkmax * sizeof(char))= ; =20 =C2=A0=C2=A0=C2=A0 if (p_line !=3D NULL && p_len !=3D NULL && p_char !=3D = NULL) { @@ -1251,7 +1251,7 @@ bool pch_swap(void) { =C2=A0=C2=A0=C2=A0 char=C2=A0=C2=A0=C2=A0 **tp_line;=C2=A0=C2=A0=C2=A0 /* = the text of the hunk */ -=C2=A0=C2=A0=C2=A0 unsigned short=C2=A0=C2=A0=C2=A0 *tp_len;/* length of e= ach line */ +=C2=A0=C2=A0=C2=A0 size_t=C2=A0=C2=A0=C2=A0 *tp_len;=C2=A0=C2=A0=C2=A0 /* = length of each line */ =C2=A0=C2=A0=C2=A0 char=C2=A0=C2=A0=C2=A0 *tp_char;=C2=A0=C2=A0=C2=A0 /* += , -, and ! */ =C2=A0=C2=A0=C2=A0 LINENUM=C2=A0=C2=A0=C2=A0 i; =C2=A0=C2=A0=C2=A0 LINENUM=C2=A0=C2=A0=C2=A0 n; @@ -1408,7 +1408,7 @@ pch_context(void) /* =C2=A0 * Return the length of a particular patch line. =C2=A0 */ -unsigned short +size_t pch_line_len(LINENUM line) { =C2=A0=C2=A0=C2=A0 return p_len[line]; diff --git a/usr.bin/patch/pch.h b/usr.bin/patch/pch.h index 5ce4f72497c7..b6c6363155a5 100644 --- a/usr.bin/patch/pch.h +++ b/usr.bin/patch/pch.h @@ -45,7 +45,7 @@ bool=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 there_is_anothe= r_patch(void); bool=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 another_hunk(void); bool=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 pch_swap(void); char=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 *pfetch(LINENUM); -unsigned short=C2=A0=C2=A0=C2=A0 pch_line_len(LINENUM); +size_t=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 pch_line_len(LINENUM); LINENUM=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 pch_first(void); LINENUM=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 pch_ptrn_lines(void); LINENUM=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 pch_newfirst(void); diff --git a/usr.bin/patch/tests/unified_patch_test.sh b/usr.bin/patch/test= s/unified_patch_test.sh index 43b0d8373cfa..7d4b74182c41 100755 --- a/usr.bin/patch/tests/unified_patch_test.sh +++ b/usr.bin/patch/tests/unified_patch_test.sh @@ -141,6 +141,24 @@ file_removal_body() =C2=A0=C2=A0=C2=A0 atf_check -o inline:"y\n" cat foo } =20 +atf_test_case plinelen +plinelen_body() +{ +=C2=A0=C2=A0=C2=A0 hello=3D"$(jot -b hello -s, 20000 | tee foo.txt)" +=C2=A0=C2=A0=C2=A0 cp foo.txt bar.txt +=C2=A0=C2=A0=C2=A0 echo "world" >>bar.txt +=C2=A0=C2=A0=C2=A0 cat >foo.diff <<EOF +--- foo.txt.orig ++++ foo.txt +@@ -1,1 +1,2 @@ + $hello ++world +EOF +=C2=A0=C2=A0=C2=A0 atf_check -o match:"Hunk #1 succeeded" \ +=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0 patch <foo.diff +=C2=A0=C2=A0=C2=A0 atf_check -o file:bar.txt cat foo.txt +} + atf_init_test_cases() { =C2=A0=C2=A0=C2=A0 atf_add_test_case basic @@ -148,4 +166,5 @@ atf_init_test_cases() =C2=A0=C2=A0=C2=A0 atf_add_test_case file_creation =C2=A0=C2=A0=C2=A0 atf_add_test_case file_nodupe =C2=A0=C2=A0=C2=A0 atf_add_test_case file_removal +=C2=A0=C2=A0=C2=A0 atf_add_test_case plinelen } =20 ------=_Part_1846856_2104703329.1707837288562 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable <html><head></head><body><div class=3D"ydp9fe492cdyahoo-style-wrap" style= =3D"font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:16px= ;"><div></div> <div dir=3D"ltr" data-setdir=3D"false"><div><div dir=3D"ltr" data-s= etdir=3D"false" style=3D"color: rgb(0, 0, 0); font-family: Helvetica Neue, = Helvetica, Arial, sans-serif; font-size: 16px;">FWIW ...</div><div dir=3D"l= tr" data-setdir=3D"false" style=3D"color: rgb(0, 0, 0); font-family: Helvet= ica Neue, Helvetica, Arial, sans-serif; font-size: 16px;"><br></div><div di= r=3D"ltr" data-setdir=3D"false" style=3D"color: rgb(0, 0, 0); font-family: = Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 16px;">We were alr= eady supporting very long lines. There was a thread like ages ago about not= making them unnecessarily longer.</div><div dir=3D"ltr" data-setdir=3D"fal= se" style=3D"color: rgb(0, 0, 0); font-family: Helvetica Neue, Helvetica, A= rial, sans-serif; font-size: 16px;"><br></div><div dir=3D"ltr" data-setdir= =3D"false" style=3D"color: rgb(0, 0, 0); font-family: Helvetica Neue, Helve= tica, Arial, sans-serif; font-size: 16px;">But I doubt anyone cares about t= hat anymore ;).</div><div dir=3D"ltr" data-setdir=3D"false" style=3D"color:= rgb(0, 0, 0); font-family: Helvetica Neue, Helvetica, Arial, sans-serif; f= ont-size: 16px;"><br></div><div dir=3D"ltr" data-setdir=3D"false" style=3D"= color: rgb(0, 0, 0); font-family: Helvetica Neue, Helvetica, Arial, sans-se= rif; font-size: 16px;">Pedro.</div></div><br></div><div><br></div> =20 </div><div id=3D"ydpa2b2e994yahoo_quoted_8834098867" class=3D"ydpa2= b2e994yahoo_quoted"> <div style=3D"font-family:'Helvetica Neue', Helvetica, Arial, s= ans-serif;font-size:13px;color:#26282a;"> =20 <div> On Monday, February 12, 2024 at 01:26:38 PM GMT-5, Dag-= Erling Sm=C3=B8rgrav <des@freebsd.org> wrote: </div> <div><br></div> <div><br></div> <div><div dir=3D"ltr">The branch main has been updated by d= es:<br></div><div dir=3D"ltr"><br></div><div dir=3D"ltr">URL: <a href=3D"ht= tps://cgit.FreeBSD.org/src/commit/?id=3D851a9da38f070675c42a6d69c41c47a5d29= ee3d0" rel=3D"nofollow" target=3D"_blank">https://cgit.FreeBSD.org/src/comm= it/?id=3D851a9da38f070675c42a6d69c41c47a5d29ee3d0</a><br></div><div dir=3D"= ltr"><br></div><div dir=3D"ltr">commit 851a9da38f070675c42a6d69c41c47a5d29e= e3d0<br></div><div dir=3D"ltr">Author: Dag-Erling Sm=C3=B8rgr= av <<a href=3D"mailto:des@FreeBSD.org" rel=3D"nofollow" target=3D"_blank= ">des@FreeBSD.org</a>><br></div><div dir=3D"ltr">AuthorDate: 2024-02-12 = 18:26:13 +0000<br></div><div dir=3D"ltr">Commit: Dag-Erling S= m=C3=B8rgrav <<a href=3D"mailto:des@FreeBSD.org" rel=3D"nofollow" target= =3D"_blank">des@FreeBSD.org</a>><br></div><div dir=3D"ltr">CommitDate: 2= 024-02-12 18:26:13 +0000<br></div><div dir=3D"ltr"><br></div><div dir=3D"lt= r"> patch: Support long context lines.<br></div><div dir=3D"lt= r"> <br></div><div dir=3D"ltr"> MFC after: = 1 week<br></div><div dir=3D"ltr"> Sponsored by:&= nbsp; Klara, Inc.<br></div><div dir=3D"ltr"> Reviewed by:&nbs= p; allanjude<br></div><div dir=3D"ltr"> Differential Re= vision: <a href=3D"https://reviews.freebsd.org/D43850" rel=3D"nofollo= w" target=3D"_blank">https://reviews.freebsd.org/D43850</a><br></div><div d= ir=3D"ltr">---<br></div><div dir=3D"ltr"> usr.bin/patch/patch.c  = ; | 2 +-<br>= </div><div dir=3D"ltr"> usr.bin/patch/pch.c &nbs= p; | 10 +++++-----<br></div><div= dir=3D"ltr"> usr.bin/patch/pch.h = | 2 +-<br></div><div dir=3D"ltr">= usr.bin/patch/tests/unified_patch_test.sh | 19 +++++++++++++++++++<br></di= v><div dir=3D"ltr"> 4 files changed, 26 insertions(+), 7 deletions(-)<br></= div><div dir=3D"ltr"><br></div><div dir=3D"ltr">diff --git a/usr.bin/patch/= patch.c b/usr.bin/patch/patch.c<br></div><div dir=3D"ltr">index 403189bc92b= 1..838c721841ea 100644<br></div><div dir=3D"ltr">--- a/usr.bin/patch/patch.= c<br></div><div dir=3D"ltr">+++ b/usr.bin/patch/patch.c<br></div><div dir= =3D"ltr">@@ -1085,7 +1085,7 @@ patch_match(LINENUM base, LINENUM offset, LI= NENUM fuzz)<br></div><div dir=3D"ltr"> LINENUM &nbs= p; pat_lines =3D pch_ptrn_lines() - fuzz;<br></div= ><div dir=3D"ltr"> const char *ilinept= r;<br></div><div dir=3D"ltr"> const char &nbs= p; *plineptr;<br></div><div dir=3D"ltr">- unsigned short&= nbsp; plinelen;<br></div><div dir=3D"ltr">+ s= ize_t plinelen;<br></div><div dir=3D"l= tr"> <br></div><div dir=3D"ltr"> /* Patch does not match= if we don't have any more context to use */<br></div><div dir=3D"ltr"> &nb= sp; if (pline > pat_lines)<br></div><div dir=3D"ltr">diff --= git a/usr.bin/patch/pch.c b/usr.bin/patch/pch.c<br></div><div dir=3D"ltr">i= ndex d528f06235bf..fb53ff86f9ef 100644<br></div><div dir=3D"ltr">--- a/usr.= bin/patch/pch.c<br></div><div dir=3D"ltr">+++ b/usr.bin/patch/pch.c<br></di= v><div dir=3D"ltr">@@ -55,7 +55,7 @@ static LINENUM p_max= ; /* max allowed value of p_end */<br>= </div><div dir=3D"ltr"> static LINENUM p_context =3D 3;&n= bsp; /* # of context lines */<br></div><div dir=3D"ltr"> static= LINENUM p_input_line =3D 0; /* current= line # from patch file */<br></div><div dir=3D"ltr"> static char &nbs= p; **p_line =3D NULL;/* the text of the hunk */<br></div><div dir=3D"= ltr">-static unsigned short *p_len =3D NULL; /* length of= each line */<br></div><div dir=3D"ltr">+static size_t *p= _len =3D NULL; /* length of each line */<br></div><div di= r=3D"ltr"> static char *p_char =3D NULL;  = ; /* +, -, and ! */<br></div><div dir=3D"ltr"> static int = hunkmax =3D INITHUNKMAX; /* size of above arrays to begi= n with */<br></div><div dir=3D"ltr"> static int p_indent;= /* indent to patch */<br></div><div dir=3D"ltr">@@ -137,= 7 +137,7 @@ set_hunkmax(void)<br></div><div dir=3D"ltr"> = if (p_line =3D=3D NULL)<br></div><div dir=3D"ltr"> &nbs= p; p_line =3D malloc(hunkmax * sizeof(char *));<br></div><div d= ir=3D"ltr"> if (p_len =3D=3D NULL)<br></div><div dir=3D"= ltr">- p_len =3D malloc(hunkmax * size= of(unsigned short));<br></div><div dir=3D"ltr">+ &n= bsp; p_len =3D malloc(hunkmax * sizeof(size_t));<br></div><div dir=3D= "ltr"> if (p_char =3D=3D NULL)<br></div><div dir=3D"ltr"= > p_char =3D malloc(hunkmax * sizeof(= char));<br></div><div dir=3D"ltr"> }<br></div><div dir=3D"ltr">@@ -154,7 +1= 54,7 @@ grow_hunkmax(void)<br></div><div dir=3D"ltr"> &n= bsp; fatal("Internal memory allocation error\n");<br></div><div= dir=3D"ltr"> <br></div><div dir=3D"ltr"> p_line =3D rea= llocf(p_line, new_hunkmax * sizeof(char *));<br></div><div dir=3D"ltr">-&nb= sp; p_len =3D reallocf(p_len, new_hunkmax * sizeof(unsigned sho= rt));<br></div><div dir=3D"ltr">+ p_len =3D reallocf(p_le= n, new_hunkmax * sizeof(size_t));<br></div><div dir=3D"ltr"> &n= bsp; p_char =3D reallocf(p_char, new_hunkmax * sizeof(char));<br></div><div= dir=3D"ltr"> <br></div><div dir=3D"ltr"> if (p_line != =3D NULL && p_len !=3D NULL && p_char !=3D NULL) {<br></div= ><div dir=3D"ltr">@@ -1251,7 +1251,7 @@ bool<br></div><div dir=3D"ltr"> pch= _swap(void)<br></div><div dir=3D"ltr"> {<br></div><div dir=3D"ltr"> &= nbsp; char **tp_line; /* the text= of the hunk */<br></div><div dir=3D"ltr">- unsigned shor= t *tp_len;/* length of each line */<br></div><div dir=3D"= ltr">+ size_t *tp_len;  = ; /* length of each line */<br></div><div dir=3D"ltr"> c= har *tp_char; /* +, -, and ! */<br></di= v><div dir=3D"ltr"> LINENUM i;<br></di= v><div dir=3D"ltr"> LINENUM n;<br></di= v><div dir=3D"ltr">@@ -1408,7 +1408,7 @@ pch_context(void)<br></div><div di= r=3D"ltr"> /*<br></div><div dir=3D"ltr"> * Return the length of a par= ticular patch line.<br></div><div dir=3D"ltr"> */<br></div><div dir= =3D"ltr">-unsigned short<br></div><div dir=3D"ltr">+size_t<br></div><div di= r=3D"ltr"> pch_line_len(LINENUM line)<br></div><div dir=3D"ltr"> {<br></div= ><div dir=3D"ltr"> return p_len[line];<br></div><div dir= =3D"ltr">diff --git a/usr.bin/patch/pch.h b/usr.bin/patch/pch.h<br></div><d= iv dir=3D"ltr">index 5ce4f72497c7..b6c6363155a5 100644<br></div><div dir=3D= "ltr">--- a/usr.bin/patch/pch.h<br></div><div dir=3D"ltr">+++ b/usr.bin/pat= ch/pch.h<br></div><div dir=3D"ltr">@@ -45,7 +45,7 @@ bool = there_is_another_patch(void);<br></div><div dir=3D"ltr"= > bool another_hunk(void);<br></div><d= iv dir=3D"ltr"> bool pch_swap(void);<b= r></div><div dir=3D"ltr"> char *pfetch= (LINENUM);<br></div><div dir=3D"ltr">-unsigned short pch_= line_len(LINENUM);<br></div><div dir=3D"ltr">+size_t &nbs= p; pch_line_len(LINENUM);<br></div><div dir=3D"ltr"> LINENUM&nb= sp; pch_first(void);<br></div><div dir=3D"lt= r"> LINENUM pch_ptrn_lines(void);<br><= /div><div dir=3D"ltr"> LINENUM pch_new= first(void);<br></div><div dir=3D"ltr">diff --git a/usr.bin/patch/tests/uni= fied_patch_test.sh b/usr.bin/patch/tests/unified_patch_test.sh<br></div><di= v dir=3D"ltr">index 43b0d8373cfa..7d4b74182c41 100755<br></div><div dir=3D"= ltr">--- a/usr.bin/patch/tests/unified_patch_test.sh<br></div><div dir=3D"l= tr">+++ b/usr.bin/patch/tests/unified_patch_test.sh<br></div><div dir=3D"lt= r">@@ -141,6 +141,24 @@ file_removal_body()<br></div><div dir=3D"ltr"> &nbs= p; atf_check -o inline:"y\n" cat foo<br></div><div dir=3D"ltr">= }<br></div><div dir=3D"ltr"> <br></div><div dir=3D"ltr">+atf_test_case pli= nelen<br></div><div dir=3D"ltr">+plinelen_body()<br></div><div dir=3D"ltr">= +{<br></div><div dir=3D"ltr">+ hello=3D"$(jot -b hello -s= , 20000 | tee foo.txt)"<br></div><div dir=3D"ltr">+ cp fo= o.txt bar.txt<br></div><div dir=3D"ltr">+ echo "world" &g= t;>bar.txt<br></div><div dir=3D"ltr">+ cat >foo.dif= f <<EOF<br></div><div dir=3D"ltr">+--- foo.txt.orig<br></div><div dir= =3D"ltr">++++ foo.txt<br></div><div dir=3D"ltr">+@@ -1,1 +1,2 @@<br></div><= div dir=3D"ltr">+ $hello<br></div><div dir=3D"ltr">++world<br></div><div di= r=3D"ltr">+EOF<br></div><div dir=3D"ltr">+ atf_check -o m= atch:"Hunk #1 succeeded" \<br></div><div dir=3D"ltr">+ &n= bsp; patch <foo.diff<br></div><div dir=3D"ltr">+ = ; atf_check -o file:bar.txt cat foo.txt<br></div><div dir=3D"lt= r">+}<br></div><div dir=3D"ltr">+<br></div><div dir=3D"ltr"> atf_init_test_= cases()<br></div><div dir=3D"ltr"> {<br></div><div dir=3D"ltr">  = ; atf_add_test_case basic<br></div><div dir=3D"ltr">@@ -148,4 +166,5 = @@ atf_init_test_cases()<br></div><div dir=3D"ltr"> atf_= add_test_case file_creation<br></div><div dir=3D"ltr"> a= tf_add_test_case file_nodupe<br></div><div dir=3D"ltr"> = atf_add_test_case file_removal<br></div><div dir=3D"ltr">+  = ; atf_add_test_case plinelen<br></div><div dir=3D"ltr"> }<br></div></div> </div> </div></body></html> ------=_Part_1846856_2104703329.1707837288562--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1620767053.1846857.1707837288566>