emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [PATCH] org-babel-goto-named-src-block bugfix and test


From: Marco Wahl
Subject: Re: [O] [PATCH] org-babel-goto-named-src-block bugfix and test
Date: Tue, 14 Jun 2016 12:36:51 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

>>> 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]