Morgan Smith <[email protected]> writes: >> Because not every single aspect of Org behavior is documented, tests are >> sometimes used as kind of reference about how the code *should* >> behave. So, having a test for something implies that one or other >> behavior (even if awkward) is intentional. In some cases, Org mode's >> behavior is weird only on a first glance. However, that behavior may be >> thoughtfully discussed on the mailing list in the past and then codified >> in the tests. Having tests that simply test for knowingly erroneous >> behavior will break such assumptions. > > Ah I see. I like the tests as a way to rigorously document a bug but > others might interpret that as rigorous documentation of org-mode > itself. I would appreciate it if we could come up with a way to > rigorously document a bug but I suppose if I just fix the bugs then it > won't be needed.
:expected-result :failed does exactly this. It just does it differently than you might be used to. Instead of documenting the *erroneous* behavior, :expected-result :failed documents the behavior we believe should occur (but does not because the bug is not yet fixed). IMHO, it is superior approach - there may be many different ways to fail the test, but only one way to pass. If we change the exact way the bug is manifested as a co-lateral of some other change, it hardly matters. > + (alist-get > + test-time > + '((2009-10-15 . " * * * * * * * \n") > + (2009-10-16 . "* * * * * * *! \n") > + (2009-10-17 . " * * * * * * ! \n") > + (2009-10-18 . " * * * * * * ! \n") > + (2009-10-19 . " * * * * * * ! \n") > + (2009-10-20 . "* * * * * * ! \n") > + (2009-10-21 . " * * * * * ! \n") > + (2009-10-22 . " * * * * * ! \n"))))) Can be even simpler. Applied, onto main, simplifying the above construct. https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=fb550976f -- Ihor Radchenko // yantar92, Org mode maintainer, 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>
