2 test_description='support for gzipped messages'
3 . $(dirname "$0")/test-lib.sh || exit 1
5 #######################################################################
7 test_begin_subtest "Single new gzipped message"
10 output=$(NOTMUCH_NEW --debug)
11 test_expect_equal "$output" "Added 1 new message to the database."
13 test_begin_subtest "Single new gzipped message (full-scan)"
15 gzip $gen_msg_filename
16 output=$(NOTMUCH_NEW --debug --full-scan 2>&1)
17 test_expect_equal "$output" "Added 1 new message to the database."
19 test_begin_subtest "Multiple new messages, one gzipped"
21 gzip $gen_msg_filename
23 output=$(NOTMUCH_NEW --debug)
24 test_expect_equal "$output" "Added 2 new messages to the database."
26 test_begin_subtest "Multiple new messages, one gzipped (full-scan)"
28 gzip $gen_msg_filename
30 output=$(NOTMUCH_NEW --debug --full-scan 2>&1)
31 test_expect_equal "$output" "Added 2 new messages to the database."
33 test_begin_subtest "Renamed (gzipped) message"
35 echo $gen_message_filename
36 notmuch new > /dev/null
37 gzip $gen_msg_filename
38 output=$(NOTMUCH_NEW --debug)
39 test_expect_equal "$output" "(D) add_files, pass 2: queuing passed file ${gen_msg_filename} for deletion from database
40 No new mail. Detected 1 file rename."
42 ######################################################################
45 test_begin_subtest "notmuch search with partially gzipped mail store"
46 notmuch search '*' | notmuch_search_sanitize > OUTPUT
48 thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Single new gzipped message (inbox unread)
49 thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Single new gzipped message (full-scan) (inbox unread)
50 thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Multiple new messages, one gzipped (inbox unread)
51 thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Multiple new messages, one gzipped (inbox unread)
52 thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Multiple new messages, one gzipped (full-scan) (inbox unread)
53 thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Multiple new messages, one gzipped (full-scan) (inbox unread)
54 thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Renamed (gzipped) message (inbox unread)
56 test_expect_equal_file EXPECTED OUTPUT
58 test_begin_subtest "notmuch search --output=files with partially gzipped mail store"
59 notmuch search --output=files '*' | notmuch_search_files_sanitize > OUTPUT
69 test_expect_equal_file EXPECTED OUTPUT
71 ######################################################################
74 test_begin_subtest "show un-gzipped message"
75 notmuch show id:msg-006@notmuch-test-suite | notmuch_show_sanitize > OUTPUT
77 \fmessage{ id:msg-006@notmuch-test-suite depth:0 match:1 excluded:0 filename:/XXX/mail/msg-006
79 Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-05) (inbox unread)
80 Subject: Multiple new messages, one gzipped (full-scan)
81 From: Notmuch Test Suite <test_suite@notmuchmail.org>
82 To: Notmuch Test Suite <test_suite@notmuchmail.org>
83 Date: Fri, 05 Jan 2001 15:43:51 +0000
86 \fpart{ ID: 1, Content-type: text/plain
87 This is just a test message (#6)
92 test_expect_equal_file EXPECTED OUTPUT
94 test_begin_subtest "show un-gzipped message (format mbox)"
95 notmuch show --format=mbox id:msg-006@notmuch-test-suite | notmuch_show_sanitize > OUTPUT
97 From test_suite@notmuchmail.org Fri Jan 5 15:43:51 2001
98 From: Notmuch Test Suite <test_suite@notmuchmail.org>
99 To: Notmuch Test Suite <test_suite@notmuchmail.org>
100 Message-Id: <msg-006@notmuch-test-suite>
101 Subject: Multiple new messages, one gzipped (full-scan)
102 Date: Fri, 05 Jan 2001 15:43:51 +0000
104 This is just a test message (#6)
107 test_expect_equal_file EXPECTED OUTPUT
109 test_begin_subtest "show un-gzipped message (format raw)"
110 notmuch show --format=raw id:msg-006@notmuch-test-suite | notmuch_show_sanitize > OUTPUT
112 From: Notmuch Test Suite <test_suite@notmuchmail.org>
113 To: Notmuch Test Suite <test_suite@notmuchmail.org>
114 Message-Id: <msg-006@notmuch-test-suite>
115 Subject: Multiple new messages, one gzipped (full-scan)
116 Date: Fri, 05 Jan 2001 15:43:51 +0000
118 This is just a test message (#6)
120 test_expect_equal_file EXPECTED OUTPUT
122 test_begin_subtest "show gzipped message"
123 notmuch show id:msg-007@notmuch-test-suite | notmuch_show_sanitize > OUTPUT
125 \fmessage{ id:msg-007@notmuch-test-suite depth:0 match:1 excluded:0 filename:/XXX/mail/msg-007.gz
127 Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-05) (inbox unread)
128 Subject: Renamed (gzipped) message
129 From: Notmuch Test Suite <test_suite@notmuchmail.org>
130 To: Notmuch Test Suite <test_suite@notmuchmail.org>
131 Date: Fri, 05 Jan 2001 15:43:50 +0000
134 \fpart{ ID: 1, Content-type: text/plain
135 This is just a test message (#7)
140 test_expect_equal_file EXPECTED OUTPUT
142 test_begin_subtest "show gzipped message (mbox)"
143 notmuch show --format=mbox id:msg-007@notmuch-test-suite | notmuch_show_sanitize > OUTPUT
145 From test_suite@notmuchmail.org Fri Jan 5 15:43:50 2001
146 From: Notmuch Test Suite <test_suite@notmuchmail.org>
147 To: Notmuch Test Suite <test_suite@notmuchmail.org>
148 Message-Id: <msg-007@notmuch-test-suite>
149 Subject: Renamed (gzipped) message
150 Date: Fri, 05 Jan 2001 15:43:50 +0000
152 This is just a test message (#7)
155 test_expect_equal_file EXPECTED OUTPUT
157 test_begin_subtest "show gzipped message (raw)"
158 notmuch show --format=raw id:msg-007@notmuch-test-suite | notmuch_show_sanitize > OUTPUT
160 From: Notmuch Test Suite <test_suite@notmuchmail.org>
161 To: Notmuch Test Suite <test_suite@notmuchmail.org>
162 Message-Id: <msg-007@notmuch-test-suite>
163 Subject: Renamed (gzipped) message
164 Date: Fri, 05 Jan 2001 15:43:50 +0000
166 This is just a test message (#7)
168 test_expect_equal_file EXPECTED OUTPUT
170 # there are more than 200 messages in this corpus
171 add_email_corpus lkml
172 test_begin_subtest "new doesn't run out of file descriptors with many gzipped files"
174 gzip --recursive ${MAIL_DIR}
175 test_expect_success "notmuch new"