aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/Makefile2
-rw-r--r--test/README6
-rwxr-xr-xtest/crypto2
-rwxr-xr-xtest/emacs71
-rwxr-xr-xtest/maildir-sync2
-rwxr-xr-xtest/multipart2
-rwxr-xr-xtest/test-lib.sh2
-rwxr-xr-xtest/uuencode4
8 files changed, 81 insertions, 10 deletions
diff --git a/test/Makefile b/test/Makefile
index b6859ea..de492a7 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -1,4 +1,4 @@
-# See Makfefile.local for the list of files to be compiled in this
+# See Makefile.local for the list of files to be compiled in this
# directory.
all:
$(MAKE) -C .. all
diff --git a/test/README b/test/README
index 07da480..be75e0e 100644
--- a/test/README
+++ b/test/README
@@ -151,7 +151,7 @@ library for your script to use.
This works similar to test_expect_equal (see above) but is used to
mark a test that demonstrates a known breakage, (that is, the
- author of the test expectes "output" and "expected" to differ until
+ author of the test expects "output" and "expected" to differ until
the breakage is fixed). See test_expect_failure for details.
test_debug <script>
@@ -181,7 +181,7 @@ writing tests:
generate_message
Generates a message with an optional template. Most tests will
- actually prefere to call add_message. See below.
+ actually prefer to call add_message. See below.
add_message
@@ -197,6 +197,6 @@ writing tests:
This function should be called at the beginning of a test file
when a test needs to operate on a non-empty body of messages. It
- will intialize the mail database to a known state of 50 sample
+ will initialize the mail database to a known state of 50 sample
messages, (culled from the early history of the notmuch mailing
list).
diff --git a/test/crypto b/test/crypto
index 8e92016..01daffe 100755
--- a/test/crypto
+++ b/test/crypto
@@ -318,7 +318,7 @@ test_expect_equal \
"$expected"
test_begin_subtest "signature verification with revoked key"
-# generate revokation certificate and load it to revoke key
+# generate revocation certificate and load it to revoke key
echo "y
1
Notmuch Test Suite key revocation (automated) $(date '+%F_%T%z')
diff --git a/test/emacs b/test/emacs
index fa3426e..6f82b08 100755
--- a/test/emacs
+++ b/test/emacs
@@ -108,6 +108,77 @@ notmuch new > /dev/null
output=$(notmuch search 'subject:"testing message sent via SMTP"' | notmuch_search_sanitize)
test_expect_equal "$output" "thread:XXX 1974-03-29 [1/1] Notmuch Test Suite; Testing message sent via SMTP (inbox)"
+test_begin_subtest "notmuch-fcc-dirs set to nil"
+test_emacs "(setq notmuch-fcc-dirs nil) (notmuch-mua-mail) (princ (buffer-string))" > OUTPUT
+cat <<EOF >EXPECTED
+From: Notmuch Test Suite <test_suite@notmuchmail.org>
+To:
+Subject:
+--text follows this line--
+EOF
+test_expect_equal_file OUTPUT EXPECTED
+
+# Make another FCC maildir specific for the next test
+mkdir -p mail/sent-string/cur
+mkdir -p mail/sent-string/new
+mkdir -p mail/sent-string/tmp
+
+test_begin_subtest "notmuch-fcc-dirs set to a string"
+test_emacs "(setq notmuch-fcc-dirs \"sent-string\") (notmuch-mua-mail) (princ (buffer-string))" > OUTPUT
+cat <<EOF >EXPECTED
+From: Notmuch Test Suite <test_suite@notmuchmail.org>
+To:
+Subject:
+Fcc: ${MAIL_DIR}/sent-string
+--text follows this line--
+EOF
+test_expect_equal_file OUTPUT EXPECTED
+
+# Make more FCC maildirs specific for the next test
+mkdir -p mail/sent-list-match/cur
+mkdir -p mail/sent-list-match/new
+mkdir -p mail/sent-list-match/tmp
+mkdir -p mail/failure/cur
+mkdir -p mail/failure/new
+mkdir -p mail/failure/tmp
+
+test_begin_subtest "notmuch-fcc-dirs set to a list (with match)"
+test_emacs "(setq notmuch-fcc-dirs '((\"notmuchmail.org\" . \"sent-list-match\") (\".*\" . \"failure\"))) (notmuch-mua-mail) (princ (buffer-string))" > OUTPUT
+cat <<EOF >EXPECTED
+From: Notmuch Test Suite <test_suite@notmuchmail.org>
+To:
+Subject:
+Fcc: ${MAIL_DIR}/sent-list-match
+--text follows this line--
+EOF
+test_expect_equal_file OUTPUT EXPECTED
+
+# Make another FCC maildir specific for the next test
+mkdir -p mail/sent-list-catch-all/cur
+mkdir -p mail/sent-list-catch-all/new
+mkdir -p mail/sent-list-catch-all/tmp
+
+test_begin_subtest "notmuch-fcc-dirs set to a list (catch-all)"
+test_emacs "(setq notmuch-fcc-dirs '((\"example.com\" . \"failure\") (\".*\" . \"sent-list-catch-all\"))) (notmuch-mua-mail) (princ (buffer-string))" > OUTPUT
+cat <<EOF >EXPECTED
+From: Notmuch Test Suite <test_suite@notmuchmail.org>
+To:
+Subject:
+Fcc: ${MAIL_DIR}/sent-list-catch-all
+--text follows this line--
+EOF
+test_expect_equal_file OUTPUT EXPECTED
+
+test_begin_subtest "notmuch-fcc-dirs set to a list (no match)"
+test_emacs "(setq notmuch-fcc-dirs '((\"example.com\" . \"failure\") (\"nomatchhere.net\" . \"failure\"))) (notmuch-mua-mail) (princ (buffer-string))" > OUTPUT
+cat <<EOF >EXPECTED
+From: Notmuch Test Suite <test_suite@notmuchmail.org>
+To:
+Subject:
+--text follows this line--
+EOF
+test_expect_equal_file OUTPUT EXPECTED
+
test_begin_subtest "Reply within emacs"
# We sed away everything before the ^From in the output to avoid getting
# confused by messages such as "Parsing /home/cworth/.mailrc... done"
diff --git a/test/maildir-sync b/test/maildir-sync
index 2b43127..c99dbec 100755
--- a/test/maildir-sync
+++ b/test/maildir-sync
@@ -85,7 +85,7 @@ test_expect_equal "$output" "No new mail."
# test created directory document in the database but this document
# was not linked as subdirectory of $MAIL_DIR. Therefore notmuch new
# could not reach the cur/ directory and its files in it during
-# recurive traversal.
+# recursive traversal.
#
# XXX: The above sounds like a bug that should be fixed. If notmuch is
# creating new directories in the mail store, then it should be
diff --git a/test/multipart b/test/multipart
index 0879696..2da9afa 100755
--- a/test/multipart
+++ b/test/multipart
@@ -209,7 +209,7 @@ Non-text part: text/html
EOF
test_expect_equal_file OUTPUT EXPECTED
-test_begin_subtest "--format=text --part=5, inline attachement"
+test_begin_subtest "--format=text --part=5, inline attachment"
notmuch show --format=text --part=5 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT
cat <<EOF >EXPECTED
attachment{ ID: 5, Content-type: text/plain
diff --git a/test/test-lib.sh b/test/test-lib.sh
index a59d1c1..cc20f41 100755
--- a/test/test-lib.sh
+++ b/test/test-lib.sh
@@ -424,7 +424,7 @@ test_begin_subtest ()
error "bug in test script: Missing test_expect_equal in ${BASH_SOURCE[1]}:${BASH_LINENO[0]}"
fi
test_subtest_name="$1"
- # Remember stdout and stderr file descriptios and redirect test
+ # Remember stdout and stderr file descriptors and redirect test
# output to the previously prepared file descriptors 3 and 4 (see
# below)
if test "$verbose" != "t"; then exec 4>test.output 3>&4; fi
diff --git a/test/uuencode b/test/uuencode
index d0d16bd..b3e1ac1 100755
--- a/test/uuencode
+++ b/test/uuencode
@@ -5,11 +5,11 @@ test_description="handling of uuencoded data"
add_message [subject]=uuencodetest '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' \
'[body]="This message is used to ensure that notmuch correctly handles a
message containing a block of uuencoded data. First, we have a marker
-this content beforeuudata . Then we beging the uunencoded data itself:
+this content beforeuudata . Then we begin the uuencoded data itself:
begin 644 bogus-uuencoded-data
M0123456789012345678901234567890123456789012345678901234567890
-MOBVIOUSLY, THIS IS NOT ANY SORT OF USEFUL UUNECODED DATA.
+MOBVIOUSLY, THIS IS NOT ANY SORT OF USEFUL UUENCODED DATA.
MINSTEAD THIS IS JUST A WAY TO ENSURE THAT THIS BLOCK OF DATA
MIS CORRECTLY IGNORED WHEN NOTMUCH CREATES ITS INDEX. SO WE
MINCLUDE A DURINGUUDATA MARKER THAT SHOULD NOT RESULT IN ANY