]> git.notmuchmail.org Git - notmuch/blob - test/emacs-show
1ddb28eb2d1ba47644c4a870ff21a4aa33d51d92
[notmuch] / test / emacs-show
1 #!/usr/bin/env bash
2
3 test_description="emacs notmuch-show view"
4 . test-lib.sh
5
6 test_begin_subtest "Hiding Original Message region at beginning of a message"
7 message_id='OriginalMessageHiding.1@notmuchmail.org'
8 add_message \
9     [id]="$message_id" \
10     '[subject]="Hiding Original Message region at beginning of a message"' \
11     '[body]="-----Original Message-----
12 Text here."'
13
14 cat <<EOF >EXPECTED
15 Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-05) (inbox)
16 Subject: Hiding Original Message region at beginning of a message
17 To: Notmuch Test Suite <test_suite@notmuchmail.org>
18 Date: Fri, 05 Jan 2001 15:43:57 +0000
19
20 [ 2-line hidden original message. Click/Enter to show. ]
21 EOF
22
23 test_emacs "(notmuch-show \"id:$message_id\")
24             (test-visible-output)"
25 test_expect_equal_file OUTPUT EXPECTED
26
27 test_begin_subtest "Bare subject #1"
28 output=$(test_emacs '(notmuch-show-strip-re "Re: subject")')
29 test_expect_equal "$output" '"subject"'
30
31 test_begin_subtest "Bare subject #2"
32 output=$(test_emacs '(notmuch-show-strip-re "re:Re: re:  Re:  re:subject")')
33 test_expect_equal "$output" '"subject"'
34
35 test_begin_subtest "Bare subject #3"
36 test_subtest_known_broken
37 output=$(test_emacs '(notmuch-show-strip-re "the cure: fix the regexp")')
38 test_expect_equal "$output" '"the cure: fix the regexp"'
39
40 test_done