Commit graph

20 commits

Author SHA1 Message Date
Mark Walters
1351aafac1 test: add tests for message only search
This adds three tests for --output=messages searches. One test is for
the case when one exclude tag does not occur in the Xapian
database. This triggers a Xapian bug in some cases and causes the
whole exclusion to fail. The next commit avoids this bug.
2012-03-18 09:14:23 -03:00
Mark Walters
fb36741bf3 test: the test for the exclude code mistakenly excludes the tag "="
The tests for the exclude code in search and count use the line
    notmuch config set search.exclude_tags = deleted
which actually sets the exclude tags to be "=" and "deleted". Remove
the "=" from this line.
2012-03-18 09:14:23 -03:00
Mark Walters
c440e597f9 test: update search test to reflect exclude flag
notmuch-search.c now returns all matching threads even if it the
match is a search.tag_excluded message (but with a mark indicating
this). Update the test to reflect this.
2012-03-02 08:31:42 -04:00
Mark Walters
98f5b0f09a test: add tests for new cli --no-exclude option
The tests test the new --no-exclude option to search and count.
There were no existing tests for the exclude behaviour for count so
added these too.
2012-03-02 08:25:46 -04:00
Pieter Praet
ba33a15ec3 config: only exclude messages if 'search.exclude_tags' is explicitly set
Currently, the 'search.exclude_tags' option is automatically
set to "deleted;spam;" if it's missing from the config file.

This violates the Principle of Least Surprise, so *only* set
'search.exclude_tags' to "deleted;spam;" if we didn't find a
configuration file at all.

This patch is actually Austin Clements' work:
  id:"20120117203211.GQ16740@mit.edu"
2012-01-23 19:21:18 -04:00
Pieter Praet
6795c62a50 test: only exclude "deleted" messages from search if explicitly configured
Currently, the 'search.exclude_tags' option is automatically set to
"deleted;spam;" if it's missing from the config file.

This violates the Principle of Least Surprise, so update the tests to
*only* expect the exclusion of messages which are tagged "deleted" if the
'search.exclude_tags' option is explicitly set *and* contains that tag.
2012-01-23 19:19:26 -04:00
Austin Clements
42a9079928 search: Support automatic tag exclusions
This adds a "search" section to the config file and an
"auto_tag_exclusions" setting in that section.  The search and count
commands pass tag tags from the configuration to the library.
2012-01-16 21:06:35 -04:00
David Bremner
7da6733e89 test: add two new messages to corpus with iso-8859-1 encoding
One is quoted printable, the other users 8 bit encoding. The latter
triggers a bug in the python bindings due to missing call to
g_mime_init. The corresponding test is marked broken in this commit.
2011-12-31 23:04:01 -04:00
David Bremner
bebf80ea68 test: use file based comparison for search '*' test
This seems a bit easier to maintain, and is more accurate since lines
are not joined together.
2011-12-31 22:59:58 -04:00
Jameson Graef Rollins
7fdeb0fb63 test: move utf-8 subject search test from json to search test script
This test doesn't have anything to do with json, and has everything to
do with testing search capability, so I'm not sure why it was in the
wrong place.
2011-06-01 16:35:11 -07:00
Jameson Graef Rollins
7a453716c2 test: Move a test from search to search-output, and add a similar json test
The "Search for non-existent message prints nothing" test fits better
with the existing tests in search-output, so move it there. Also add a
similar test for the --format=json case.

These tests also use the new test_expect_equal_file function, (to ensure
that the presence of a trailing newline is correctly tested).
2011-06-01 16:31:52 -07:00
Jameson Graef Rollins
1d6b49561f tag signed/encrypted during notmuch new
This patch adds the tag "signed" to messages with any multipart/signed
parts, and the tag "encrypted" to messages with any
multipart/encrypted parts.  This only occurs when messages are indexed
during notmuch new, so a database rebuild is required to have old
messages tagged.
2011-05-27 16:22:00 -07: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
Carl Worth
99ad348deb search: Move lwn tests into their own file.
Since it's much easier to debug and fix these if they can be run on
their own.
2011-03-09 15:10:03 -08:00
Thomas Schwinge
12f4443e23 Add a few tests for searching LWN emails.
These tests should pass -- but they currently don't.

Signed-off-by: Thomas Schwinge <thomas@schwinge.name>
2011-03-09 15:10:03 -08:00
Michal Sojka
24d42f0507 test: Fix bugs detected thanks to the previous commit 2010-11-16 11:28:06 -08:00
Michal Sojka
c6b59ea3c6 test: Search for non-existent message should return nothing
My scripts expect that empty search result is actually empty. Since
commit 6dcb7592, even empty search prints a newline character and this
breaks my scripts.

This patch adds a test for this bug. In the test I cannot use
test_expect_equal function as $() operator suppresses the final
newline and this kind of difference is not detected.

 test/search |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
2010-11-04 12:34:33 -07:00
Carl Worth
5497b01c27 test: Fix the search and dump-restore tests to operator on non-empty mail store.
We do this with a new add_email_corpus function that establishes a
mail store with 50 messages from the notmuch mailing list.
2010-09-20 16:40:35 -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/t0002-search.sh (Browse further)