diff options
| author | David Bremner <david@tethera.net> | 2024-08-10 14:36:21 -0300 |
|---|---|---|
| committer | David Bremner <david@tethera.net> | 2025-03-13 07:18:07 -0300 |
| commit | eb48d78758394c7241a1aa83a24cfd61e0a3c9fa (patch) | |
| tree | cc31f4ea1884aa2de6e5114cb893e2a59eb459ff /test | |
| parent | b5ba3ff5ef9c2f39326883eff745108537aef89c (diff) | |
test/emacs: add tests for hl-line-mode integration
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.
Diffstat (limited to 'test')
| -rwxr-xr-x | test/T312-emacs-hl-line.sh | 170 |
1 files changed, 170 insertions, 0 deletions
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 + |
