Commit graph

13 commits

Author SHA1 Message Date
Tomi Ollila
a755c9d6a9 test: renamed test scripts to format T\d\d\d-name.sh
All test scripts to be executed are now named as T\d\d\d-name.sh,
numers in increments of 10.

This eases adding new tests and developers to see which are test scripts
that are executed by test suite and in which order.
2014-01-13 14:16:46 -04:00
Austin Clements
e41cd1c518 test: Canonicalize RFC 2047 encoding and charset
RFC 2047 states that the encoding and charset in an encoded word are
case-insensitive, so force them to lower case in the reply test.  This
fixes an issue caused by GMime versions (somewhere between 2.6.10 and
2.6.16), which changed the capitalization of the encoding.
2013-08-20 09:14:25 +02:00
Austin Clements
dc51bf0ad4 reply: Use RFC 2822/MIME wholly for text format template
Previously, reply's default text format used an odd mix of RFC 2045
MIME encoding for the reply template's body and some made-up RFC
2822-like UTF-8 format for the headers.  The intent was to present the
headers to the user in a nice, un-encoded format, but this assumed
that whatever ultimately sent the email would RFC 2047-encode the
headers, while at the same time the body was already RFC 2045 encoded,
so it assumed that whatever sent the email would *not* re-encode the
body.

This can be fixed by either producing a fully decoded UTF-8 reply
template, or a fully encoded MIME-compliant RFC 2822 message.  This
patch does the latter because it is

a) Well-defined by RFC 2822 and MIME (while any UTF-8 format would be
   ad hoc).

b) Ready to be piped to sendmail.  The point of the text format is to
   be minimal, so a user should be able to pop up the template in
   whatever editor they want, edit it, and push it to sendmail.

c) Consistent with frontend capabilities.  If a frontend has the
   smarts to RFC 2047 encode the headers before sending the mail, it
   probably has the smarts to RFC 2047 decode them before presenting
   the template to a user for editing.

Also, as far as I know, nothing automated consumes the reply text
format, so changing this should not cause serious problems.  (And if
anything does still consume this format, it probably gets these
encoding issues wrong anyway.)
2013-08-17 09:06:08 +02:00
Austin Clements
6cdab6e0b7 reply: Remove extraneous space from generated References
Previously, the References header code seemed to assume
notmuch_message_get_header would return NULL if the header was not
present, but it actually returns "".  As a result of this, it was
inserting an unnecessary space when concatenating an empty or missing
original references header with the new reference.

This shows up in only two tests because the text reply format later
passes the whole reply template through g_mime_filter_headers, which
has the side effect of stripping out this extra space.
2013-08-17 09:05:44 +02:00
Austin Clements
ad7bb423fb reply: Test replying to messages with RFC 2047-encoded headers 2013-08-17 09:04:07 +02:00
Jani Nikula
2f1a11268f test: add tests for notmuch reply From guessing
Add tests for picking up user's From address from fallback headers
Envelope-To, X-Original-To, and Delivered-To.

Signed-off-by: Jani Nikula <jani@nikula.org>
2012-05-24 21:56:35 -03:00
Tomi Ollila
da9f392165 test: whitespace-cleanup for most test/* files
Used emacs (whitespace-cleanup) function to "cleanup blank problems"
in test files where that could be done without breaking tests;
test/emacs was partially, and test/multipart was fully reverted.
2012-01-22 09:12:12 -04:00
Jani Nikula
982096d79d cli: pick the user's address in a group list as from address
Messages received to a group list were not replied to using the from
address in the list. Fix it.

Signed-off-by: Jani Nikula <jani@nikula.org>
2012-01-16 21:06:34 -04:00
Jani Nikula
93150f6467 test: add known broken test for reply from address in named group list
If a message was received to the user's address that was in a named
group list, notmuch reply does not use that address for picking the
from address.

Groups lists are of the form: foo:bar@example.com,baz@example.com;

Signed-off-by: Jani Nikula <jani@nikula.org>
2012-01-16 21:06:34 -04:00
Joel Borggrén-Franck
3fa843216c test: change "#!/bin/bash" to "#!/usr/bin/env bash" enhances portability
Change #!/bin/bash at start of tests to "#!/usr/bin/env bash". That way
systems running on bash < 4 can prepend bash >= 4 to path before
running the tests.
2011-05-27 14:03:28 -07:00
Jameson Rollins
04b27c0d4c test: Update tests with removal of bcc from reply
Update the tests so that they no longer expect the Bcc header in the
output of "notmuch reply" now that it has been removed.

Edited-by Carl Worth: Simply applying the change to our newly
modularized test suite.
2010-10-27 17:34:31 -07:00
Carl Worth
ba9f9efc9a test: Remove useless NOTMUCH variable (in favor of simply "notmuch")
When the NOTMUCH variable was originally invented it was used as an
explicit path to the notmuch binary being tested. Today, the test
suite sets the PATH variable instead, so the NOTMUCH variable always
has a value of simply "notmuch".

We simplifying that by using the constant value rather than the
continual variable reference.
2010-09-20 16:15:08 -07:00
Carl Worth
7263aa9ec3 test: Rename all tests to get rid of the ugly numbers in file names.
The numbers were meaningless, and they made it hard to find a file of interest.

Instead, we get the ordering we want by adding an explicit list of
tests to run to the notmuch-test script.
2010-09-17 16:01:42 -07:00
Renamed from test/t0005-reply.sh (Browse further)