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 gzipped message"
95 test_subtest_known_broken
96 notmuch show id:msg-007@notmuch-test-suite | notmuch_show_sanitize > OUTPUT
98 \fmessage{ id:msg-007@notmuch-test-suite depth:0 match:1 excluded:0 filename:/XXX/mail/msg-007.gz
100 Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-05) (inbox unread)
101 Subject: Renamed (gzipped) message
102 From: Notmuch Test Suite <test_suite@notmuchmail.org>
103 To: Notmuch Test Suite <test_suite@notmuchmail.org>
104 Date: Fri, 05 Jan 2001 15:43:50 +0000
107 \fpart{ ID: 1, Content-type: text/plain
108 This is just a test message (#7)
113 test_expect_equal_file EXPECTED OUTPUT