On Tue, Nov 08 2022, Ihor Radchenko wrote: > Leo Butler 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, Thanks for your feeback and the pointer. I have revised the tests and attach the revised patch. Best regards, Leo