Morgan Smith <[email protected]> writes:

> I also want to ask a question about test naming though.  What is the
> standard for naming tests?  This is actually a pretty important question
> I think because that's used for ERT selectors.
>
> It seems to be something like this with many exceptions:
>
> #+begin_src elisp
> (rx
>  (optional "test-")

This one is indeed inconsistent.

>  (literal FILE-NAME)
>  (or "-" "/")

"-" is very rare. We should probably go with majority.

>  (literal (string-trim-left FUNCTION-NAME
>                             (rx (literal FILE-NAME) (one-or-more "-"))))
>  (optional
>   (or "-" "/")
>   (literal EXTRA-DESCRIPTOR)))
> #+end_src
>
> Personally, I think the current formula is a little lax.
>
> Should the beginning "test-" be optional or do we want to fix that?  Is
> it redundant information that can simply be removed?

Probably redundant, honestly.
Tests are not functions and do not occupy function slow of a symbol. So,
we do not need to worry about namespace beyond other existing tests.

That said, de facto Emacs test convention is function name for testing
function behavior and "test-*" for testing generic behavior not tied to
a single function.

> Are we ok with the file-name separator being "[-/]" or should we
> standardize on "/"?

"/" will probably make more sense. At least, it will make selectors
somewhat easier.

> Also where do we want to shove in the word 'characterization'?  Would it
> be better not not shove it in and just make it a tag?

I think we do not need it in the names, as discussed in a related thread.

> Should we change the default ERT selector to exclude characterization
> tests?  I believe we should to prevent new contributors from fighting
> frivolous noise.

With a comment marking characterization tests, I do not think that it is
a problem.

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>

Reply via email to