Ihor Radchenko <[email protected]> writes:
Hi,
I am wondering about the logic behind this commit. It is not
really testing org-log-into-drawer or org-todo but the behavior
of folding, which is not really "Test `org-log-into-drawer'
specifications." as in the test docstring.
I do not object testing the visibility, but the implementations
feels like a scope creep for that particular test.
You're not wrong. I did the easiest modification I could and
called it a day. Maybe there was better way to test this.
In my defense, I do test that this bug remains fixed regardless of
the `org-log-into-drawer' specifications.
The bug I was fixing was in `org-log-beginning'. It's a little
hard to figure out what actually calls this function due to
indirections and hooks but I think it's called by 'org-clock-out',
'org-refile', 'org-todo', and 'org-add-note'.
Elisp is a great language to unit test in as it's easy to override
stuff, but it's pretty clear Org Mode isn't the easiest thing to
unit test.
If someone was inclined to do refactors, then we should probably
factor out drawer creation into it's own function and then unit
test that function in isolation.
It would probably also be useful to extract the
'visible-buffer-string' function so it can be used across tests.
Many tests in "test-org-fold" just test is a specific char is
invisible instead of the entire buffer.
And with the above thinking I have now turned a simple bug report
into two larger tasks. Sometimes I try to push a fix fast to
avoid getting stuck in perfectionism.