From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id kP/NHwuAlmBWlAAAgWs5BA (envelope-from ) for ; Sat, 08 May 2021 14:11:55 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id OHNmGwuAlmDMXwAAB5/wlQ (envelope-from ) for ; Sat, 08 May 2021 12:11:55 +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) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id EED0CBAF0 for ; Sat, 8 May 2021 14:11:54 +0200 (CEST) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 8A5FF27E0A; Sat, 8 May 2021 08:11:36 -0400 (EDT) Received: from fethera.tethera.net (unknown [198.245.60.197]) by mail.notmuchmail.org (Postfix) with ESMTP id 7ED8B271D0 for ; Sat, 8 May 2021 08:11:27 -0400 (EDT) Received: by fethera.tethera.net (Postfix, from userid 1001) id 3A49F6081C; Sat, 8 May 2021 08:11:26 -0400 (EDT) Received: (nullmailer pid 3455125 invoked by uid 1000); Sat, 08 May 2021 12:11:22 -0000 From: David Bremner To: notmuch@notmuchmail.org Cc: jonas@bernoul.li, David Bremner Subject: [PATCH 1/3] test: add known broken tests for notuch-{before,after}-tag-hook Date: Sat, 8 May 2021 09:11:11 -0300 Message-Id: <20210508121113.3454994-2-david@tethera.net> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210508121113.3454994-1-david@tethera.net> References: <20210508121113.3454994-1-david@tethera.net> MIME-Version: 1.0 Message-ID-Hash: ACUKDGCPOXBH5QZFGPW6LAU67TF67RLW X-Message-ID-Hash: ACUKDGCPOXBH5QZFGPW6LAU67TF67RLW X-MailFrom: bremner@tethera.net 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-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1620475915; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=CEgXgR8yn/oL8v3LxZEPrfC5wktqINkXs6PzyuO1VjM=; b=CCgdifht7Fv9BiZ/YwphSaq5c5OpvkC0ngQ0rP/fBu6TX4iuEpF0beoVbRSN1mkrQQ4QPj WTqOLVAOVzhEHhp4h0c1DAJ+a05JHYA97XIScTvpO8JmMgm9aMVJJWu3PpQyVRrUFS0dUI MrUrT/hZYi2jzobPdBlH1TjGFhjHUl0KTL9kDBGQ3A1jQQOA4ayQL2B5iLegYExHvKfr8C VVsZw3m4hZwLPrNB3zHgU9hffLXO6eaMBx2Kia52UN1ppVBKOT2ohmcHp9xIqJIfFbiNm3 stprOfsNUsgZlR0dNtTmP/ohP3dQlH9TpMYLDBaKadlGEuglzYpFnQUztcpQlA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1620475915; a=rsa-sha256; cv=none; b=KBnpo04NkIY6y9oFWo3jfhYN50v3Yr67eJF8w5jIWi1YlrfZb1BJlc38A5UOp/BUoX0Q2O 1cu97NYlahf6c+Ou8WWcUIDIsGaB/uN6BrZ4lt3bCN/IpfvCBFUn/DzEytqbk7w1YnXCIU NJkWOgOKF2w2z05VzRUKNoN1vS2qBb3e+OLD27scFQMLwgmvOdyBk1ZkDOo1BPzi3ZYodm UgTb+VXILAFeF9etlYGgF+ofi3Du+6oev3HAqL0srUXDGyxRIBrytD/n3YL4WGICyCdtKB be0eJpaZmHZG5zTe0VNQZrflwPbPko6fb1rdAhgCSr0U79SgCTey3UNLMnWVxA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=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-Migadu-Spam-Score: -1.07 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-Migadu-Queue-Id: EED0CBAF0 X-Spam-Score: -1.07 X-Migadu-Scanner: scn0.migadu.com X-TUID: W20r8Zb8xEyI These tests illustrate the bug reported in id:87v97ytd2s.fsf@fastmail.fm --- test/T310-emacs.sh | 24 ++++++++++++++++++++++++ test/test-lib.el | 3 +++ 2 files changed, 27 insertions(+) diff --git a/test/T310-emacs.sh b/test/T310-emacs.sh index 78ac19a8..5ebc8e66 100755 --- a/test/T310-emacs.sh +++ b/test/T310-emacs.sh @@ -161,6 +161,30 @@ test_emacs "(notmuch-show \"$os_x_darwin_thread\") output=$(notmuch search $os_x_darwin_thread | notmuch_search_sanitize) test_expect_equal "$output" "thread:XXX 2009-11-18 [4/4] Jjgod Jiang, Alexander Botero-Lowry; [notmuch] Mac OS X/Darwin compatibility issues (inbox unread)" +test_begin_subtest "notmuch-show: before-tag-hook is run, variables are defined" +test_subtest_known_broken +output=$(test_emacs '(let ((notmuch-test-tag-hook-output nil) + (notmuch-before-tag-hook (function notmuch-test-tag-hook))) + (notmuch-show "id:ddd65cda0911171950o4eea4389v86de9525e46052d3@mail.gmail.com") + (execute-kbd-macro "+activate-hook\n") + (execute-kbd-macro "-activate-hook\n") + notmuch-test-tag-hook-output)') +test_expect_equal "$output" \ +'(("id:ddd65cda0911171950o4eea4389v86de9525e46052d3@mail.gmail.com" "-activate-hook") + ("id:ddd65cda0911171950o4eea4389v86de9525e46052d3@mail.gmail.com" "+activate-hook"))' + +test_begin_subtest "notmuch-show: after-tag-hook is run, variables are defined" +test_subtest_known_broken +output=$(test_emacs '(let ((notmuch-test-tag-hook-output nil) + (notmuch-after-tag-hook (function notmuch-test-tag-hook))) + (notmuch-show "id:ddd65cda0911171950o4eea4389v86de9525e46052d3@mail.gmail.com") + (execute-kbd-macro "+activate-hook\n") + (execute-kbd-macro "-activate-hook\n") + notmuch-test-tag-hook-output)') +test_expect_equal "$output" \ +'(("id:ddd65cda0911171950o4eea4389v86de9525e46052d3@mail.gmail.com" "-activate-hook") + ("id:ddd65cda0911171950o4eea4389v86de9525e46052d3@mail.gmail.com" "+activate-hook"))' + test_begin_subtest "Message with .. in Message-Id:" add_message [id]=123..456@example '[subject]="Message with .. in Message-Id"' test_emacs '(notmuch-search "id:\"123..456@example\"") diff --git a/test/test-lib.el b/test/test-lib.el index 4de5b292..32d53736 100644 --- a/test/test-lib.el +++ b/test/test-lib.el @@ -99,6 +99,9 @@ running, quit if it terminated." (add-hook 'notmuch-hello-refresh-hook (lambda () (cl-incf notmuch-hello-refresh-hook-counter))) +(defvar notmuch-test-tag-hook-output nil) +(defun notmuch-test-tag-hook () (push (cons query tag-changes) notmuch-test-tag-hook-output)) + (defun notmuch-test-mark-links () "Enclose links in the current buffer with << and >>." ;; Links are often created by jit-lock functions -- 2.30.2