unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
blob 26f22aa0766e6a5dfadebf23e0ccbf1af24a5f69 4099 bytes (raw)
name: test/T740-gzip.sh 	 # note: path name is non-authoritative(*)

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
 
#!/usr/bin/env bash
test_description='support for gzipped messages'
. $(dirname "$0")/test-lib.sh || exit 1

#######################################################################
# notmuch new
test_begin_subtest "Single new message"
generate_message
gzip -9 $gen_msg_filename
output=$(NOTMUCH_NEW --debug)
test_expect_equal "$output" "Added 1 new message to the database."

test_begin_subtest "Single message (full-scan)"
generate_message
gzip -9 $gen_msg_filename
output=$(NOTMUCH_NEW --debug --full-scan 2>&1)
test_expect_equal "$output" "Added 1 new message to the database."

test_begin_subtest "Multiple new messages, one gzipped"
generate_message
gzip -9 $gen_msg_filename
generate_message
output=$(NOTMUCH_NEW --debug)
test_expect_equal "$output" "Added 2 new messages to the database."

test_begin_subtest "Multiple new messages (full-scan)"
generate_message
gzip -9 $gen_msg_filename
generate_message
output=$(NOTMUCH_NEW --debug --full-scan 2>&1)
test_expect_equal "$output" "Added 2 new messages to the database."

test_begin_subtest "Renamed (gzipped) message"
generate_message
echo $gen_message_filename
notmuch new > /dev/null
gzip $gen_msg_filename
output=$(NOTMUCH_NEW --debug)
test_expect_equal "$output" "(D) add_files, pass 2: queuing passed file ${gen_msg_filename} for deletion from database
No new mail. Detected 1 file rename."

######################################################################
# notmuch search

test_begin_subtest "notmuch search with partially gzipped mail store"
notmuch search '*' | notmuch_search_sanitize > OUTPUT
cat <<EOF > EXPECTED
thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; Single new message (inbox unread)
thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; Single message (full-scan) (inbox unread)
thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; Multiple new messages, one gzipped (inbox unread)
thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; Multiple new messages, one gzipped (inbox unread)
thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; Multiple new messages (full-scan) (inbox unread)
thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; Multiple new messages (full-scan) (inbox unread)
thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; Renamed (gzipped) message (inbox unread)
EOF
test_expect_equal_file EXPECTED OUTPUT

test_begin_subtest "notmuch search --output=files with partially gzipped mail store"
notmuch search --output=files '*' | notmuch_search_files_sanitize > OUTPUT
cat <<EOF > EXPECTED
MAIL_DIR/msg-001.gz
MAIL_DIR/msg-002.gz
MAIL_DIR/msg-003.gz
MAIL_DIR/msg-004
MAIL_DIR/msg-005.gz
MAIL_DIR/msg-006
MAIL_DIR/msg-007.gz
EOF
test_expect_equal_file EXPECTED OUTPUT

######################################################################
# notmuch show

test_begin_subtest "show un-gzipped message"
notmuch show id:msg-006@notmuch-test-suite | notmuch_show_sanitize > OUTPUT
cat <<EOF > EXPECTED
\fmessage{ id:msg-006@notmuch-test-suite depth:0 match:1 excluded:0 filename:/XXX/mail/msg-006
\fheader{
Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-05) (inbox unread)
Subject: Multiple new messages (full-scan)
From: Notmuch Test Suite <test_suite@notmuchmail.org>
To: Notmuch Test Suite <test_suite@notmuchmail.org>
Date: Fri, 05 Jan 2001 15:43:51 +0000
\fheader}
\fbody{
\fpart{ ID: 1, Content-type: text/plain
This is just a test message (#6)
\fpart}
\fbody}
\fmessage}
EOF
test_expect_equal_file EXPECTED OUTPUT

test_begin_subtest "show gzipped message"
test_subtest_known_broken
notmuch show id:msg-007@notmuch-test-suite | notmuch_show_sanitize > OUTPUT
cat <<EOF > EXPECTED
\fmessage{ id:msg-007@notmuch-test-suite depth:0 match:1 excluded:0 filename:/XXX/mail/msg-007.gz
\fheader{
Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-05) (inbox unread)
Subject: Renamed (gzipped) message
From: Notmuch Test Suite <test_suite@notmuchmail.org>
To: Notmuch Test Suite <test_suite@notmuchmail.org>
Date: Fri, 05 Jan 2001 15:43:50 +0000
\fheader}
\fbody{
\fpart{ ID: 1, Content-type: text/plain
This is just a test message (#7)
\fpart}
\fbody}
\fmessage}
EOF
test_expect_equal_file EXPECTED OUTPUT

test_done

debug log:

solving 26f22aa0 ...
found 26f22aa0 in https://yhetil.org/notmuch/20190324033244.12909-2-david@tethera.net/

applying [1/1] https://yhetil.org/notmuch/20190324033244.12909-2-david@tethera.net/
diff --git a/test/T740-gzip.sh b/test/T740-gzip.sh
new file mode 100755
index 00000000..26f22aa0

Checking patch test/T740-gzip.sh...
Applied patch test/T740-gzip.sh cleanly.

index at:
100755 26f22aa0766e6a5dfadebf23e0ccbf1af24a5f69	test/T740-gzip.sh

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).