[PATCH] test/emacs: test toggling order of search buffer twice

Subject: [PATCH] test/emacs: test toggling order of search buffer twice

Date: Wed, 21 Jan 2026 22:38:22 +0900

To: notmuch@notmuchmail.org

Cc:

From: David Bremner


This should yield the same output as the initial search.
---
 test/T310-emacs.sh | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

We should also add a test for toggling once, but I think
that needs a new output file to test against.

diff --git a/test/T310-emacs.sh b/test/T310-emacs.sh
index e96c1601..6d12609b 100755
--- a/test/T310-emacs.sh
+++ b/test/T310-emacs.sh
@@ -41,6 +41,20 @@ test_emacs '(notmuch-search "tag:inbox")
 	    (test-output)'
 test_expect_equal_file $EXPECTED/notmuch-search-tag-inbox OUTPUT
 
+test_begin_subtest "toggle order twice"
+test_emacs '(let ((old (default-value notmuch-search-oldest-first)))
+	      (setq-default notmuch-search-oldest-first nil)
+	      (notmuch-search "tag:inbox")
+	      (notmuch-test-wait)
+	      (goto-char (point-min))
+	      (notmuch-search-toggle-order)
+	      (notmuch-test-wait)
+	      (notmuch-search-toggle-order)
+	      (notmuch-test-wait)
+	      (test-output)
+	      (setq-default notmuch-search-oldest-first old))'
+test_expect_equal_file $EXPECTED/notmuch-search-tag-inbox OUTPUT
+
 test_begin_subtest "Functions in search-result-format"
 test_emacs '(let
 		((notmuch-search-result-format
-- 
2.51.0

_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: