]> git.notmuchmail.org Git - notmuch/blob - test/T210-raw.sh
Merge tag 'debian/0.17-5'
[notmuch] / test / T210-raw.sh
1 #!/usr/bin/env bash
2
3 test_description='notmuch show --format=raw'
4 . ./test-lib.sh
5
6 add_message
7 add_message
8
9 test_begin_subtest "Attempt to show multiple raw messages"
10 output=$(notmuch show --format=raw "*" 2>&1)
11 test_expect_equal "$output" "Error: search term did not match precisely one message."
12
13 test_begin_subtest "Show a raw message"
14 output=$(notmuch show --format=raw id:msg-001@notmuch-test-suite | notmuch_date_sanitize)
15 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
16 To: Notmuch Test Suite <test_suite@notmuchmail.org>
17 Message-Id: <msg-001@notmuch-test-suite>
18 Subject: Test message #1
19 Date: GENERATED_DATE
20
21 This is just a test message (#1)"
22
23 test_begin_subtest "Show another raw message"
24 output=$(notmuch show --format=raw id:msg-002@notmuch-test-suite | notmuch_date_sanitize)
25 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
26 To: Notmuch Test Suite <test_suite@notmuchmail.org>
27 Message-Id: <msg-002@notmuch-test-suite>
28 Subject: Test message #2
29 Date: GENERATED_DATE
30
31 This is just a test message (#2)"
32
33 test_done