Hi,

On Mon, 12 Oct 2026 at 14:49, Daniel Gustafsson <[email protected]> wrote:
>
> We have a fairly common pattern in the TAP tests where we first unlink() a
> config file and then do append_conf() on it in order to rewrite it from
> scratch.  There's nothing wrong with it but it's IMO not as readable as it can
> be (especially when unlink and append_conf are vertically separated), and
> slightly errorprone as the unlink requires one to assemble the path whereas
> append_conf does that automatically (yes, I have done that exact mistake 
> during
> hacking).
>
> To make the TAP tests more readable I propose a utility function which 
> combines
> these two operations, replace_conf().  It works just like how unlink() 
> together
> with append_conf() does but in fewer and more readable lines of code.  I chose
> replace rather than rewrite since it IMO more clearly signals that nothing in
> the file is kept.

Thanks for the patch! It makes sense to me to have this function, makes
the tests easier to follow.

Small nit on the replace vs rewrite thing you mentioned: should we change
the below comment too to use "replacing"?

-A shortcut method for rewriting a configuration file.
+A shortcut method for replacing a configuration file.

Also, I noticed the forked-backend SKIP block in
src/test/ssl/t/004_sni.pl still skips 11 tests. Since we're removing the
ok(unlink(...)) assertion, ig that should be 10 now.

Regards,
Ayush


Reply via email to