emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] How to add a test?


From: Nicolas Goaziou
Subject: Re: [O] How to add a test?
Date: Sun, 28 Feb 2016 16:10:33 +0100

Hello,

George M Jones <address@hidden> writes:

> What's the process for adding a test (specifically to babel)?
>
> The only part that looks non-obvious is how to generate the test ID,
> e.g. in ob-shell-test.org:
>
>   * Associative array tests (simple map)
>     :PROPERTIES:
>     :ID:       bec1a5b0-4619-4450-a8c0-2a746b44bf8d
>     :END:
>
> From there it looks like you just add to the correct file in
> org-mode/testing/examples/*.org and the corresponding
> /org-mode/testing/lisp/test-*.el file.  Am I missing anything?
>
> I'll add to the README or docs unless it's already there.

I suggest to stay away from examples/ and `org-test-at-id' altogether.
I find these tests horrible to debug when something goes wrong.

I suggest to stay with `org-test-with-temp-text', or, if needed,
`org-test-with-temp-text-in-file' and make the test self-contained.
Also, I think it is better to have only one `should' or related, outside
of this macro, so the whole test is easier to evaluate partially. See,
e.g., "test-org-footnote.el".

Obviously YMMV and the more important thing is to have more tests. How
tests are written is a lesser matter. Feel free to ignore my
suggestions.

Thank you for your work.


Regards,

-- 
Nicolas Goaziou



reply via email to

[Prev in Thread] Current Thread [Next in Thread]