>>> The test uses lines like: >>> >>> (execute-kbd-macro "\M-xorg-babel-goto-named-src-block\n\n") >>> >>> to emulate interactive usage. >>> >>> This feels like a hack, and the messages generated spill into my >>> *shell* buffer when I run `make test'. If there is a cleaner way to >>> do this, I'd like to know it. >>> >>> WDYT? >> >> Why not just use e.g. >> >> (org-babel-goto-named-src-block "def") >> > > Because that does not test the `(interactive ...)' form, which > comprises most of the code in `org-babel-goto-named-src-block'.
Okay. I have no idea for a cleaner implementation of these tests. AFAICS these tests look good (and also your code.) If someone has a better idea for the tests they can be changed. I would drop test #v+ ;; non-existent name (should-not (execute-kbd-macro "\M-xorg-babel-goto-named-src-block\ndef\n")) #v- because its outcome has nothing to do with the existence of the name "def" AFAICS. Or maybe replace with (should (string= "source-code block `non-existent' not found in this buffer" (org-babel-goto-named-src-block "non-existent"))) +1 for commit! Best regards, -- Marco Wahl -- GPG: 0x49010A040A3AE6F2
