[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] [PATCH 1/2] Add tests for org-refile-get-targets
From: |
Sebastian Reuße |
Subject: |
Re: [O] [PATCH 1/2] Add tests for org-refile-get-targets |
Date: |
Wed, 17 May 2017 20:43:52 +0200 |
User-agent: |
mu4e 0.9.19; emacs 25.2.1 |
Hello Nicolas,
Nicolas Goaziou <address@hidden> writes:
> Nitpick: Sections in test-org.el are sorted alphabetically. So the new
> "Refile" section could go between "Radio Targets" and "Sparse trees".
Thank you, I hadn’t noticed.
> Would it be possible to split this big test into smaller ones, with
> a description about what is really tested? See other tests in
> "test-org.el" for some examples. Big tests tend to not being very
> informative when they fail. IMO, code duplication is not an issue in
> test files when it makes tests more readable/useful.
Sure. Have a look at the follow-up patch and let me know what you think.
It didn’t feel right copy-pasting the tests wholesale, so I made a
helper-macro. I checked the ert output by forcing a failure and the
failure explanation looks as expected. Does this work for you?
> It would be even better if you can avoid relying on real files ("a.org"
> and "b.org" in your patch), but if it makes the test too convoluted, no
> worries.
In the follow-up, I stuck with this primarily because of the
‘full-file-path’ test. I figure one could somehow mock a file-backed
buffer, but I expected that would be too involved just to have
everything inlined in the test. Let me know if you think differently
though.
Kind regards,
SR
--
Insane cobra split the wood
Trader of the lowland breed
Call a jittney, drive away
In the slipstream we will stay