mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-24 20:08:10 +01:00
test: `notmuch-test-run' should protect against buffer switching.
The body of the test may cause the current buffer to change. Ensure that the output goes to the correct buffer by switching back before inserting it.
This commit is contained in:
parent
c70c7f86b8
commit
2f50524e27
1 changed files with 3 additions and 1 deletions
|
@ -92,7 +92,9 @@ nothing."
|
|||
(defmacro notmuch-test-run (&rest body)
|
||||
"Evaluate a BODY of test expressions and output the result."
|
||||
`(with-temp-buffer
|
||||
(let ((result (progn ,@body)))
|
||||
(let ((buffer (current-buffer))
|
||||
(result (progn ,@body)))
|
||||
(switch-to-buffer buffer)
|
||||
(insert (if (stringp result)
|
||||
result
|
||||
(prin1-to-string result)))
|
||||
|
|
Loading…
Reference in a new issue