Morgan Smith <[email protected]> writes:
> I've been trying to do some interactive testing so that I can use testcover to
> create new tests for `org-agenda-format-item' as Ihor suggested.
>
> I've been quite annoyed at the constant prompts while running the test suite
> and then when trying to close Emacs so here is a patch to fix that!
>
> I've tested this in batch-mode on Emacs 28.2, Emacs 29.4, and Emacs 30.2. I
> tested it interactively on Emacs 30.2. I've done this using guix and will
> share
> my methods in the future as they should be quite reproducible (and maybe good
> in a CI?).
Thanks! Comments below.
> (ert-deftest ob-tangle/bibtex ()
> "Tangle BibTeX into a `.bib' file."
> - (let ((file (make-temp-file "org-tangle-" nil ".org"))
> - (bib "@Misc{example,
> + (let ((bib "@Misc{example,
> ...
> - (unwind-protect
> - (with-current-buffer (find-file-noselect file)
> - (insert (format "#+begin_src bibtex :tangle yes
> + (org-test-with-temp-text-in-file
> + (format "#+begin_src bibtex :tangle yes
> %s
> -#+end_src"
> ...
> - (let ((bib-file
> - (if (fboundp 'file-name-with-extension)
> - (file-name-with-extension file "bib")
> - ;; Emacs <28
> - (concat (file-name-sans-extension file) "." "bib"))))
> - (should (file-exists-p bib-file))
> - (should (string= (string-trim (org-file-contents bib-file))
> - bib))))
> - (delete-file file))))
This won't work. FILE variable is used to derive the tangled file name.
Same for some clauses you changed in test-org-capture/org-capture-expand-olp.
--
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>