X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=test%2Ftest-lib.el;h=5dd6271c99dceb16417d947b87a731874d7c7c72;hp=5b32e0abe4d524f272922f119fce3bcea6d57fec;hb=f94a50d80af8c2a5513e58db954dd0b1910eb4a8;hpb=c70c7f86b83601231bac94db8a6596a1d729ae24 diff --git a/test/test-lib.el b/test/test-lib.el index 5b32e0ab..5dd6271c 100644 --- a/test/test-lib.el +++ b/test/test-lib.el @@ -89,10 +89,20 @@ nothing." (add-hook-counter 'notmuch-hello-mode-hook) (add-hook-counter 'notmuch-hello-refresh-hook) +(defadvice notmuch-search-process-filter (around pessimal activate disable) + "Feed notmuch-search-process-filter one character at a time." + (let ((string (ad-get-arg 1))) + (loop for char across string + do (progn + (ad-set-arg 1 (char-to-string char)) + ad-do-it)))) + (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)))