I'm writing tests for an interactive function. I've been using the
unread-command-events variable in conjunction with
call-interactively to verify that it does the right thing.
However, I just discovered that this doesn't work in batch mode.
(defun my-dummy (s) (interactive "sWrite something: ") s) (ert-deftest my-dummy-test () (let ((unread-command-events (listify-key-sequence "Hi!\n"))) (should (equal (call-interactively #'my-dummy) "Hi!"))))
ert in interactive mode, this works. However, in batch mode, Emacs stops and read the keyboard without consuming input from
In this a bug in batch mode or is this the expected behaviour?
Is there any other way to do this in batch mode?