From f94a50d80af8c2a5513e58db954dd0b1910eb4a8 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Mon, 9 Jul 2012 17:42:39 -0400 Subject: test: New test for incremental search output parsing This advises the search process filter to make it process one character at a time in order to test the pessimal case for incremental search output parsing. The text parser fails this test because it gets tricked into thinking a parenthetical remark in a subject is the tag list. --- test/test-lib.el | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test/test-lib.el') diff --git a/test/test-lib.el b/test/test-lib.el index 6271da22..5dd6271c 100644 --- a/test/test-lib.el +++ b/test/test-lib.el @@ -89,6 +89,14 @@ 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 -- cgit v1.2.3