From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id OG4cJBGSLl//fwAA0tVLHw (envelope-from ) for ; Sat, 08 Aug 2020 11:52:49 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id gOcJIBGSLl9WOQAAB5/wlQ (envelope-from ) for ; Sat, 08 Aug 2020 11:52:49 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [144.217.243.247]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (2048 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 4F62194066A for ; Sat, 8 Aug 2020 11:52:49 +0000 (UTC) Received: from [144.217.243.247] (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id E42C629B93; Sat, 8 Aug 2020 07:51:42 -0400 (EDT) Received: from mail.hostpark.net (mail.hostpark.net [212.243.197.30]) by mail.notmuchmail.org (Postfix) with ESMTPS id 47DFF29ACE for ; Sat, 8 Aug 2020 07:50:15 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.hostpark.net (Postfix) with ESMTP id 94BD916A8A for ; Sat, 8 Aug 2020 13:50:11 +0200 (CEST) X-Virus-Scanned: by Hostpark/NetZone Mailprotection at hostpark.net Received: from mail.hostpark.net ([127.0.0.1]) by localhost (mail0.hostpark.net [127.0.0.1]) (amavisd-new, port 10124) with ESMTP id 7ZlEAoGq6Lnx for ; Sat, 8 Aug 2020 13:50:11 +0200 (CEST) Received: from customer (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.hostpark.net (Postfix) with ESMTPSA id 6BF001661F for ; Sat, 8 Aug 2020 13:50:11 +0200 (CEST) From: Jonas Bernoulli To: notmuch@notmuchmail.org Subject: [PATCH v3 32/34] emacs: Do not abuse advice to monkey patch while testing Date: Sat, 8 Aug 2020 13:50:07 +0200 Message-Id: <20200808115009.24071-33-jonas@bernoul.li> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200808115009.24071-1-jonas@bernoul.li> References: <20200726165818.400-1-jonas@bernoul.li> <20200808115009.24071-1-jonas@bernoul.li> MIME-Version: 1.0 Message-ID-Hash: V5EUZZM4NOCEJIGUR5ZD5EYRLKHFUAR3 X-Message-ID-Hash: V5EUZZM4NOCEJIGUR5ZD5EYRLKHFUAR3 X-MailFrom: jonas@bernoul.li X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.1 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 144.217.243.247 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Spam-Score: 0.03 X-TUID: ytbxtk04bN5V Use `cl-letf*' instead. --- test/T310-emacs.sh | 14 ++++++++------ test/test-lib.el | 8 -------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/test/T310-emacs.sh b/test/T310-emacs.sh index 5f74305d..78ac19a8 100755 --- a/test/T310-emacs.sh +++ b/test/T310-emacs.sh @@ -40,12 +40,14 @@ test_emacs '(notmuch-search "tag:inbox") test_expect_equal_file $EXPECTED/notmuch-search-tag-inbox OUTPUT test_begin_subtest "Incremental parsing of search results" -test_emacs "(ad-enable-advice 'notmuch-search-process-filter 'around 'pessimal) - (ad-activate 'notmuch-search-process-filter) - (notmuch-search \"tag:inbox\") - (notmuch-test-wait) - (ad-disable-advice 'notmuch-search-process-filter 'around 'pessimal) - (ad-activate 'notmuch-search-process-filter) +test_emacs "(cl-letf* (((symbol-function 'orig) + (symbol-function 'notmuch-search-process-filter)) + ((symbol-function 'notmuch-search-process-filter) + (lambda (proc string) + (cl-loop for char across string + do (orig proc (char-to-string char)))))) + (notmuch-search \"tag:inbox\") + (notmuch-test-wait)) (test-output)" test_expect_equal_file $EXPECTED/notmuch-search-tag-inbox OUTPUT diff --git a/test/test-lib.el b/test/test-lib.el index 044c2da4..ec16c59c 100644 --- a/test/test-lib.el +++ b/test/test-lib.el @@ -97,14 +97,6 @@ (defvar notmuch-hello-refresh-hook-counter -100 (add-hook 'notmuch-hello-refresh-hook (lambda () (cl-incf notmuch-hello-refresh-hook-counter))) -(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))) - (cl-loop for char across string - do (progn - (ad-set-arg 1 (char-to-string char)) - ad-do-it)))) - (defun notmuch-test-mark-links () "Enclose links in the current buffer with << and >>." ;; Links are often created by jit-lock functions -- 2.28.0