On Wed, Dec 14, 2022 at 2:11 PM Michael Albinus <
michael.albinus@gmx.de> wrote:
> Both conventions are used: <package>-test-FOO and <package>-tests-FOO.
> In the test/ subdirectory, (dired-do-find-regexp "deftest.*-tests-")
> returns 1073 lines, and (dired-do-find-regexp "deftest.*-test-") returns
> 1245 lines. If you prefer the "eglot-tests" prefix, rename it (I really
> don't care :-)
OK. I don't know either, I'll decide later. I'll just mention if we
used shorthands, we could align conventions effortlessly
:-D. That's another annoyance about these prefix systems:
near-endless repetition and hard maintenance.
> > - (eglot--call-with-tramp-test #'eglot-tests--lsp-abiding-column-1))
> > + (eglot--with-tramp-test ()
> > + (skip-unless (executable-find "clangd" 'remote))
> > + (eglot-tests--lsp-abiding-column-1)))
> >
> > (ert-deftest eglot-test-path-to-uri-windows ()
> > (skip-unless (eq system-type 'windows-nt))
>
> Might work. You could also remove function eglot--call-with-tramp-test,
> and move its body into the macro eglot--with-tramp-test.
I could, but I really do like the WITH-FOO/CALL-WITH-FOO
convention. Among other benefits like easier hygiene it
means that recompiling the function is all I need to have it
take effect everywhere. With macros you have to recompile
all the expanders. Only worth it for very performance sensitive
code where you can't afford the funcall. That's quite rare IME.
> I don't know
> whether skip-unless then still works (it is applicable inside
> ert-deftest only), but you could replace its call by ert-skip as I have done.
Yes, probably. No biggie.
João