From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id QGc7CWWmt2bBSAAAe85BDQ:P1 (envelope-from ) for ; Sat, 10 Aug 2024 17:41:57 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id QGc7CWWmt2bBSAAAe85BDQ (envelope-from ) for ; Sat, 10 Aug 2024 19:41:57 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=tethera.net header.s=2024 header.b=Xg64+xhl; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1723311716; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to: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-owner:list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=1wXdC7nCp4Ep5jmt7AfZDt7nlIGzF2WqVtVH9fpcTpA=; b=WTs5scMzgKbETeG7XG2dnGX2HWRLPi5mkIz1jGxvwx7eyUXNr4Hyy6INzctoifzfkxuvHV QcMG0mqjj9zFGRK7vId7hKjs7l7O9o9zZCj6HVyXY+e96z300fr6//l8QBdNrW5fP8c2da 7cwtDDxnvgOMv97ZKFdcfa1YpBR37X4S7fgdnSWigNFr7cdw4fghfq2Xf7b0zSL7i3aqyU ZlT7WjqV05QxqyQQXej0fI8W/aExdJnaOeGzqamfp5SsqO7mDqYD2W1iMypB+axQbqsWbU TOJPjMU8YLLwdpzoDUNy4HXG3WCW/rK/jR64RCJ47VB/AfKGxvJH/LyengZzPA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1723311716; a=rsa-sha256; cv=none; b=dDUIjcsVJ3dXPruRT1rDc8OSuZGP4lJlBouv0wvYHqu2q+nl/De5aukd40faMyswqdRR5Z dTsyT2CZ28ian6jKJzrd3mfllcOjzxJb02bHSey+YAfkQKWfayvqCkkobuw2PhtrTkR4E6 o8rOwdzw1fL2rxu7RSJ1riiim0tyVqRzdCRIo1ItFUtbFAZvAzVUmZmmpZ7xRB26W6Y2Iu GWqVeFMNKfhPXwTydLp0Qh8AfZSydl1Vcx5jv455EuLSdUiqTRUrpIC7/R7zYGZqaoLJGt vz+r4BMaFPfMtz94WN9D6J8596jTXdgSC6aCV6z+qmTPFeRhyS8M5j9Ozol1dg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=tethera.net header.s=2024 header.b=Xg64+xhl; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org Received: from mail.notmuchmail.org (yantan.tethera.net [135.181.149.255]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id E60871A243 for ; Sat, 10 Aug 2024 19:41:56 +0200 (CEST) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 26C085F86C; Sat, 10 Aug 2024 17:41:38 +0000 (UTC) Received: from phubs.tethera.net (phubs.tethera.net [IPv6:2607:5300:60:3a9d::1]) by mail.notmuchmail.org (Postfix) with ESMTPS id A26515F835 for ; Sat, 10 Aug 2024 17:41:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tethera.net; i=@tethera.net; q=dns/txt; s=2024; t=1723311692; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : from; bh=d8L9bb8YYEo4XmBa0/AbX38u5oajnu+jOCE4pL03mp0=; b=Xg64+xhluZCjKQGcC7mL59iqQnJ/Tzm7vQMyu5vitFrDnTVDpfGoo/4wYEPZYpiuFttOG dkzG2+DB/3ttH3M9SCgP4XRGOEKBLeppVf6mPRTHZjo0BQ5mgmmIjM+oWQfA/q5Crj+5h0d cseqqILmPmrseN/c5WJ/Afx3u0DqeUtQVXK0fxkN7T+9I/saYIjMh58secXHXdDBa6YOOfu zVbJlSBaVHJe27GwvQpDvQWC0OrVxO26SoDEfs1zRdCdVpkqeZrfjtt4NUbyZLQqnnQ4r2D rkpDwY/YE5WurHClGkwtm57ZFPn54SMiPG0oIqLJGuRtefBGTwq+UswI6BZA== Received: from tethera.net (fctnnbsc51w-159-2-211-58.dhcp-dynamic.fibreop.nb.bellaliant.net [159.2.211.58]) by phubs.tethera.net (Postfix) with ESMTPS id 3318318006E; Sat, 10 Aug 2024 14:41:32 -0300 (ADT) Received: (nullmailer pid 426481 invoked by uid 1000); Sat, 10 Aug 2024 17:41:27 -0000 From: David Bremner To: notmuch@notmuchmail.org Subject: [PATCH 2/6] test/emacs: add tests for hl-line-mode integration Date: Sat, 10 Aug 2024 14:36:21 -0300 Message-ID: <20240810174121.425192-3-david@tethera.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240810174121.425192-1-david@tethera.net> References: <20240810174121.425192-1-david@tethera.net> MIME-Version: 1.0 Message-ID-Hash: 46U4IKWFQCDNFICMB2R4QIMCSMLANUKU X-Message-ID-Hash: 46U4IKWFQCDNFICMB2R4QIMCSMLANUKU 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; digests; suspicious-header X-Mailman-Version: 3.3.3 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN X-Migadu-Country: DE X-Migadu-Queue-Id: E60871A243 X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: 0.31 X-Spam-Score: 0.31 X-TUID: erGJmMaVSRrW Most of the known broken tests replicate (my intepretation of) the bug reported at id:87fsfuuxwn.fsf@thinkbox (or some unreported, but probably related bugs in tree/unthreaded view). The last 3 broken tests are just unimplimented planned functionality. --- test/T312-emacs-hl-line.sh | 170 +++++++++++++++++++++++++++++++++++++ 1 file changed, 170 insertions(+) create mode 100755 test/T312-emacs-hl-line.sh diff --git a/test/T312-emacs-hl-line.sh b/test/T312-emacs-hl-line.sh new file mode 100755 index 00000000..4cceed30 --- /dev/null +++ b/test/T312-emacs-hl-line.sh @@ -0,0 +1,170 @@ +#!/usr/bin/env bash + +test_description="emacs hl-line-mode" +. $(dirname "$0")/test-lib.sh || exit 1 +. $NOTMUCH_SRCDIR/test/test-lib-emacs.sh || exit 1 + +EXPECTED=$NOTMUCH_SRCDIR/test/emacs.expected-output + +test_require_emacs +add_email_corpus + +test_begin_subtest "line 1, search" +test_emacs_expect_t '(let ((notmuch-hl-line t)) + (notmuch-search "tag:inbox") + (notmuch-test-wait) + (notmuch-test-expect-equal + (let ((start (overlay-start hl-line-overlay)) + (end (overlay-end hl-line-overlay))) + (list start (> end start))) + (list 1 t)))' + +test_begin_subtest "line 1, tree" +test_subtest_known_broken +test_emacs_expect_t '(let ((notmuch-hl-line t)) + (notmuch-tree "tag:inbox") + (notmuch-test-wait) + (notmuch-test-expect-equal + (let ((start (overlay-start hl-line-overlay)) + (end (overlay-end hl-line-overlay))) + (list start (> end start))) + (list 1 t)))' + +test_begin_subtest "line 1, unthreaded" +test_subtest_known_broken +test_emacs_expect_t '(let ((notmuch-hl-line t)) + (notmuch-tree "tag:inbox") + (notmuch-test-wait) + (notmuch-test-expect-equal + (let ((start (overlay-start hl-line-overlay)) + (end (overlay-end hl-line-overlay))) + (list start (> end start))) + (list 1 t)))' + +test_begin_subtest "line 1, search, refresh" +test_emacs_expect_t '(let ((notmuch-hl-line t)) + (notmuch-search "tag:inbox") + (notmuch-test-wait) + (notmuch-refresh-this-buffer) + (notmuch-test-wait) + (notmuch-test-expect-equal (overlay-start hl-line-overlay) 1))' + +test_begin_subtest "line 1, tree, refresh" +test_subtest_known_broken +test_emacs_expect_t '(let ((notmuch-hl-line t)) + (notmuch-tree "tag:inbox") + (notmuch-test-wait) + (notmuch-refresh-this-buffer) + (notmuch-test-wait) + (notmuch-test-expect-equal + (let ((start (overlay-start hl-line-overlay)) + (end (overlay-end hl-line-overlay))) + (list start (> end start))) + (list 1 t)))' + +test_begin_subtest "line 1, unthreaded, refresh" +test_subtest_known_broken +test_emacs_expect_t '(let ((notmuch-hl-line t)) + (notmuch-tree "tag:inbox") + (notmuch-test-wait) + (notmuch-refresh-this-buffer) + (notmuch-test-wait) + (notmuch-test-expect-equal + (let ((start (overlay-start hl-line-overlay)) + (end (overlay-end hl-line-overlay))) + (list start (> end start))) + (list 1 t)))' + + +test_begin_subtest "line 12, notmuch-search" +test_emacs_expect_t '(let ((notmuch-hl-line t)) + (notmuch-search "tag:inbox") + (notmuch-test-wait) + (forward-line 11) + (notmuch-post-command) + (notmuch-test-expect-equal + (line-number-at-pos (overlay-start hl-line-overlay)) 12))' + +test_begin_subtest "line 12, tree" +test_emacs_expect_t '(let ((notmuch-hl-line t)) + (notmuch-tree "tag:inbox") + (notmuch-test-wait) + (forward-line 11) + (notmuch-post-command) + (notmuch-test-expect-equal + (line-number-at-pos (overlay-start hl-line-overlay)) 12))' + +test_begin_subtest "line 12, unthreaded" +test_emacs_expect_t '(let ((notmuch-hl-line t)) + (notmuch-unthreaded "tag:inbox") + (notmuch-test-wait) + (forward-line 11) + (notmuch-post-command) + (notmuch-test-expect-equal + (line-number-at-pos (overlay-start hl-line-overlay)) 12))' + +test_begin_subtest "line 12, search, refresh" +test_subtest_known_broken +test_emacs_expect_t '(let ((notmuch-hl-line t)) + (notmuch-search "tag:inbox") + (notmuch-test-wait) + (forward-line 11) + (notmuch-post-command) + (notmuch-refresh-this-buffer) + (notmuch-test-wait) + (notmuch-test-expect-equal + (line-number-at-pos (overlay-start hl-line-overlay)) 12))' + +test_begin_subtest "line 12, tree, refresh" +test_subtest_known_broken +test_emacs_expect_t '(let ((notmuch-hl-line t)) + (notmuch-tree "tag:inbox") + (notmuch-test-wait) + (forward-line 11) + (notmuch-post-command) + (notmuch-refresh-this-buffer) + (notmuch-test-wait) + (notmuch-test-expect-equal + (line-number-at-pos (overlay-start hl-line-overlay)) 12))' + +test_begin_subtest "line 12, unthreaded, refresh" +test_subtest_known_broken +test_emacs_expect_t '(let ((notmuch-hl-line t)) + (notmuch-tree "tag:inbox") + (notmuch-test-wait) + (forward-line 11) + (notmuch-post-command) + (notmuch-refresh-this-buffer) + (notmuch-test-wait) + (notmuch-test-expect-equal + (line-number-at-pos (overlay-start hl-line-overlay)) 12))' + +test_begin_subtest "hl-line disabled, search" +test_subtest_known_broken +test_emacs_expect_t '(let ((notmuch-hl-line nil)) + (notmuch-search "tag:inbox") + (notmuch-test-wait) + (notmuch-test-expect-equal + (or hl-line-mode hl-line-overlay) + nil))' + +test_begin_subtest "hl-line disabled, tree" +test_subtest_known_broken +test_emacs_expect_t '(let ((notmuch-hl-line nil)) + (notmuch-tree "tag:inbox") + (notmuch-test-wait) + (notmuch-test-expect-equal + (or hl-line-mode hl-line-overlay) + nil))' + +test_begin_subtest "hl-line disabled, unthreaded" +test_subtest_known_broken +test_emacs_expect_t '(let ((notmuch-hl-line nil)) + (notmuch-unthreaded "tag:inbox") + (notmuch-test-wait) + (notmuch-test-expect-equal + (or hl-line-mode hl-line-overlay) + nil))' + +test_done + -- 2.43.0