[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] rfc: using ert-deftest with side-effects
From: |
Ihor Radchenko |
Subject: |
Re: [PATCH] rfc: using ert-deftest with side-effects |
Date: |
Tue, 08 Nov 2022 07:40:28 +0000 |
Leo Butler <Leo.Butler@umanitoba.ca> writes:
> However, I would like feedback/suggestions on writing such a
> test. Issues include:
>
> 1. how to clean up the side-effects, including changes in the test
> buffer, filesystem and potentially creating an error buffer;
As you did, we generally use unwind-protect. Also, we prefer putting
temporary files into temporary directory.
You can grep for `make-temp-file' and `delete-file' in tests. There are
plenty of examples.
> 2. the general absence of similar tests (except in test-ob.el,
> test-ob/result-graphics-link-type-header-argument).
> ...
> I am unsure about 2. Is the absence of such tests because there is a
> policy against them, or ...
We have no such policy. In fact, many tests are making
temporary files.
--
Ihor Radchenko // yantar92,
Org mode contributor,
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>
- [PATCH] rfc: using ert-deftest with side-effects, Leo Butler, 2022/11/07
- Re: [PATCH] rfc: using ert-deftest with side-effects,
Ihor Radchenko <=
- [PATCH] lisp/ob-octave.el, was [PATCH] rfc: using ert-deftest with side-effects, Leo Butler, 2022/11/08
- Re: [PATCH] lisp/ob-octave.el, was [PATCH] rfc: using ert-deftest with side-effects, Ihor Radchenko, 2022/11/09
- Re: [PATCH] lisp/ob-octave.el, was [PATCH] rfc: using ert-deftest with side-effects, Leo Butler, 2022/11/09
- Re: [PATCH] lisp/ob-octave.el, was [PATCH] rfc: using ert-deftest with side-effects, Ihor Radchenko, 2022/11/14
- Re: [PATCH] lisp/ob-octave.el, was [PATCH] rfc: using ert-deftest with side-effects, Leo Butler, 2022/11/15