aboutsummaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2011-05-31test: Add test showing notmuch corrupts a part with a CRLF pair in itCarl Worth
Since commit 2f8871df6ea3c0b44f85a0fc1b4f58a6b70b0a0e notmuch has been using a function (show_part_content) originally written only for text parts to save all MIME parts. The problem with this is that this function converts CRLF pairs to LF only and optionally converts to UTF-8 encoding. These two conversions have the potential to corrupt binary data when passed through the function. This test demonstrates that corruption, and so fails currently, until we fix the bug.
2011-05-31test: Fix a misspelling in one of our test cases.Carl Worth
Not that it affects the correctness of the test, but it's nice to use proper spelling. This kind of change could invalidate a signature on the test message, but I think that would have happened previously when the HTML part was added in the first place.
2011-05-31test: add test for saving attachments using notmuch-show-save-partDmitry Kurochkin
Use .gz filenames for saved attachments in the tests to check that Emacs does not re-compress the file. Use test_expect_equal_file instead of test_expect_equal to avoid binary output on the console.
2011-05-31test: copy files in test_expect_equal_file instead of moving themDmitry Kurochkin
Before the change, test_expect_equal_file moved files it compared in case of failure. The patch changes it to copy the files instead. This allows testing non-temporary files which are stored in git. Note: the change should not result in new temporary files left after the tests. Test_expect_equal_file used to move files only on failure, so callers had to cleanup them anyway.
2011-05-27Render all parts of multipart/encrypted when decrypting.Jameson Graef Rollins
The primary goal here is to keep the decrypted output as similarly structured as undecrypted output as possible. Now, when decrypting parts, only the original encrypted part is replaced by the it's decrypted content. If this part isn't itself a multipart, then all part numbering should remain consistent during decryption. The only draw back here is that the useless application/pgp-encrypted sub-part of the multipart/encrypted part is also emitted. But this part can be easily ignored by clients.
2011-05-27Do not replace multipart/signed part with content part when doing verification.Jameson Graef Rollins
Some folks have complained about the part renumbering that occurs when the entire multipart/signed part is replaced with the part contents after verification. This is primarily because it incurs an additional computational cost to retrieve individual parts, since verification has to be performed again to ensure that part numbering is consistent. This patch simply leaves the full multipart/signed part as is. The emacs crypto test is also updated to reflect this change.
2011-05-27tag signed/encrypted during notmuch newJameson Graef Rollins
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-27test: add crypto tests for signature verification and decryptionJameson Graef Rollins
This adds a new "crypto" test script to the test suite to test PGP/MIME signature verification and message decryption. Included here is a test GNUPGHOME with a test secret key (passwordless), and test for: * signing/verification * signing/verification with full owner trust * verification with signer key unavailable * encryption/decryption * decryption failure with missing key * encryption/decryption + signing/verfifying * reply to encrypted message * verification of signature from revoked key These tests are not expected to pass now, but will as crypto functionality is included.
2011-05-27test: add notmuch_show_sanitize_all function that is a little more aggressive.Jameson Graef Rollins
The old notmuch_show_sanitize function only scrubed part of the filename. This one scrubs the full filename, as well as the message id.
2011-05-27test: new test-lib function to test for equality between filesJameson Graef Rollins
We need to be able to test for the presence of a newline at the end of output. There's no good way to capture trailing newlines in bash, so redirecting output to a file is the next best thing. This new function should be used when testing for output that is expected to have trailing newlines. The next commit will demonstrate the use of this.
2011-05-27test: use `princ' instead of `message' calls in emacs testsDmitry Kurochkin
The patch replaces all (message (buffer-string)) calls in emacs tests with (princ (buffer-string)). This avoids accidentally interpreting '%' as format specifiers and makes code simpler because we do not need to capture stderr. Also, the patch works around an Emacs (23.3+1-1 on current Debian Unstable) segfault in "Ensure that emacs doesn't drop results" test. Note: the segfault does not happen on every test run. Though, it seems to be consistently reproducible if the test uses 300 messages instead of 30. Hopefully, it is the crash described in Emacs bug #8545 [1] which is already fixed. [1] http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8545
2011-05-27Update some more recent tests to use /usr/bin/env to find bashCarl Worth
The recentl-applied patch had grown stale, so update the tests that had been created since it was originally written.
2011-05-27test: change "#!/bin/bash" to "#!/usr/bin/env bash" enhances portabilityJoel Borggrén-Franck
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-26test: add test-lib.el file with `visible-buffer-string' functionDmitry Kurochkin
The patch adds test-lib.el file for Emacs tests auxiliary stuff. Currently, it implements two functions: `visible-buffer-string' and `visible-buffer-substring'. These are similar to standard counterparts without "visible-" prefix but exclude invisible text. The functions are not used anywhere at the moment but should be useful for testing hiding/showing in the Emacs interface. Edited-by: Carl Worth <cworth@cworth.org> Fixed "basic" test to ignore new test-lib.el file.
2011-05-24test: add test for hiding/showing signature in notmuch-show viewDmitry Kurochkin
2011-05-24test: fix expected output for emacs tests after the wash button label changesDmitry Kurochkin
2011-05-24test: Expand multipart test to cover "notmuch reply" as wellCarl Worth
This gives coverage for the segmentation fault in "notmuch reply" that was just fixed with the previous commit.
2011-05-24test: Expand multipart test to cover part output in all formats.Jameson Graef Rollins
The example multipart message is made a bit more complicated by adding a message/rfc822 message, and the all parts are output and tested in all output formats.
2011-05-23test: force deletion of test remnantsJameson Graef Rollins
This keeps the test from failing if only a subset of the remnants were available for deletion, because e.g. only a subset of the tests were run.
2011-05-23test: allow specifying tests to run with NOTMUCH_TESTS env varJameson Graef Rollins
This is useful for just running a specific subset of tests, ie: NOTMUCH_TESTS=crypto make test
2011-05-20test: remove hard-coded paths from multipart testJameson Graef Rollins
Small oversite, easily corrected.
2011-05-18emacs: Show cleaner `From:' addresses in the summary line.David Edmondson
Remove double quotes and flatten "foo@bar.com <foo@bar.com>" to "foo@bar.com". Edited-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net> (clean up expected output for emacs tests). Signed-off-by: Jameson Rollins <jrollins@finestructure.net>
2011-05-18test: Link to compat files when building program during "make test"Carl Worth
The compilation of the smtp-dummy program would fail if a build was attempted on a system without getline. Fix this by simply including the existing notmuch_compat_srcs variable when constructing the list of source files for compiling smtp-dummy.
2011-05-17notmuch show: Properly nest MIME parts within mulipart partsCarl Worth
Previously, notmuch show flattened all output, losing information about the nesting of the MIME hierarchy. Now, the output is properly nested, (both in the --format=text and --format=json output), so that clients can analyze the original MIME structure. Internally, this required splitting the final closing delimiter out of the various show_part functions and putting it into a new show_part_end function instead. Also, the show_part function now accepts a new "first" argument that is set not only for the first MIME part of a message, but also for each first MIME part within a series of multipart parts. This "first" argument controls the omission of a preceding comma when printing a part (for json). Many thanks to David Edmondson <dme@dme.org> for originally identifying the lack of nesting in the json output and submitting an early implementation of this feature. Thanks as well to Jameson Graef Rollins <jrollins@finestructure.net> for carefully shepherding David's patches through a remarkably long review process, patiently explaining them, and providing a cleaned up series that led to this final implementation. Jameson also provided the new emacs code here.
2011-05-17notmuch show: Include output for the enclosing multipart part of a MIME mailCarl Worth
Previously, the outer multipart part of any multipart/mixed, multipart/signed, etc. MIME message was silently omitted from the "notmuch show" output. This prevented any client from correctly determining to which parts a signature applies, for example. Now, we actually emit these parts as their own parts. The output is still flattened---the contained parts are not yet included "within" the multipart part---so it's still not possible to determine to which parts a signature applies, but this is one step along the path. The test suite is updated to reflect this change, (though we'll eventually want to fix the emacs interface to not display buttons for the multipart enclosure parts as there's nothing useful for the user to actually do with them).
2011-05-16test: Add a test of "notmuch show" with a multipart messageCarl Worth
This tests "notmuch show" with both --format=text and --format=json on a message with some non-trivial MIME multipart nesting, (multiple parts within a multipart/mixed part which is within a multipart/signed part). The test captures the current behavior (where only the leaf nodes of the MIME structure are emitted as a flat list---the multipart parts are effectively ignored). We plan to soon change the json output at least to emit an actual hierarchy matching the MIME structure, (at which point we will update this test).
2011-04-25test: Mark the search-insufficient-from-quoting tests to expect successCarl Worth
Theses were expected failures only due to a bug in GMime (with versions of GMime before 2.4.18). As of GMime version 2.4.18 this bug is fixed and these tests now pass.
2011-03-10emacs: Don't drop error messages from "notmuch search"Carl Worth
With the previous commit, unexpected output before or between search results would be displayed. However, trailing junk from the "notmuch search" output would still be silently swallowed. The most common case for an error message from "notmuch search" would be an invalid command-line, and in that case, there would be no search results and the trailing error message would get swallowed. We fix the process sentinel to check for leftover data and add it to the final buffer. We also add a test case to ensure this works.
2011-03-10emacs: Display any unexpected output from notmuch searchCarl Worth
Rather than silently swallowing unexpected output, the emacs interface will now display it. This will allow error messages to actually arrive at the emacs interface (though not in an especially pretty way). This also allows for easier investigation of the inadvertent swallowing of search results that span page boundaries (as demonstrated by the recent added emacs-large-search-buffer test). The page-boundary bug has been present since a commit from 2009-11-24: 93af7b574598637c2766dd1f8ef343962c9a8efb Many thanks to Thomas Schwinge for tracking that bug down and contributing the test for it.
2011-03-10Rename/rewrite the new emacs-forgetfulness test (to emacs-large-search-buffer)Carl Worth
The new name is more descriptive of the bug being tested. Also, the test is rewritten slightly so that it's much more plain to see how the bug manifests itself, (that messages are droped from the emacs result at regular intervals). Primarily, this is by collapsing the large blobs used to inflate the message subjects.
2011-03-10New test: Emacs' forgetfulness.Thomas Schwinge
Signed-off-by: Thomas Schwinge <thomas@schwinge.name>
2011-03-09json: Fix search result with no matches to be a valid json object.Carl Worth
In the original json code, search matching nothing would return a valid, empty json array (that is, "[]"). I broke this in commit 6dcb7592e32ed5140ea0c0357ce78d6a37af6066 when adding support for --output=threads|messages|tags. This time, while fixing the bug also add a test to the test suite to help avoid future regressions.
2011-03-09test: Rename and clarify the search-lwn testCarl Worth
Now that we understand the bug here, we rename this test to search-insufficient-from-quoting to clarify the bug being exercised, (which occurs when the From: line contains an unquoted '.' character). We also mark these tests as expected failures until the bug gets fixed.
2011-03-09search: Move lwn tests into their own file.Carl Worth
Since it's much easier to debug and fix these if they can be run on their own.
2011-03-09Add a few tests for searching LWN emails.Thomas Schwinge
These tests should pass -- but they currently don't. Signed-off-by: Thomas Schwinge <thomas@schwinge.name>
2011-01-28Clarify usage of `additional_headers' in test/test-lib.sh:generate_message.Thomas Schwinge
Signed-off-by: Thomas Schwinge <thomas@schwinge.name>
2011-01-26test: Make it easier to resolve conflicts when adding new testsMichal Sojka
Currently, there are two places in the test framework that contain very long list on a single line. Whenever a test is added (or changed) in several branches and these branches are merged, it results in conflict which is hard to resolve because one has to go through the whole long line to find where the conflict is. This patch splits these long lists to several lines so that the conflicts are easier to resolve.
2011-01-26Add test demonstrating a position overlap bug.Carl Worth
Currently, whenever we call index_terms multiple times for a single field, the term generator is being reset to position 0 each time. This means that with text such as: To: a@b.c, x@y.z one can get a bogus match by searching for: To: a@y.c Thanks to Mark Anderson for reporting the bug, (and providing a nice, minimal test case that inspired what is used here).
2011-01-15test: Add new tests for folder-based searching.Carl Worth
This is a new feature which is not implemente yet, so these tests mostly fail currently. A subsequent commit will add the feature and cause these tests to start passing. These tests verify that we can search for containing folders of mail files by word or by phrase and that the search terms are updated correctly when directories are renamed.
2011-01-15Fix misspelling in a comment.Carl Worth
Just a simple change I noticed in passing.
2011-01-15test/basic: Ignore new files ending in ~Carl Worth
We don't need to complain that temporary editor backups are not added to the list of tests to be run.
2010-12-07Update test suite for 7 tests that were recently fixed.Carl Worth
These tests had been broken, but were fixed by the preceding commit, so update the test suite to print PASS rather than FIXED for these.
2010-12-07Revert "test: Break on test script (or other) error"Carl Worth
This reverts commit f22a7ec1e28d1264cf9d67d78796b8ab22e09a35. Interrupting the test suite due to an actual bug in a test script would be just fine, but interrupting the run of the entire test suite at the first test failure is unacceptable.
2010-12-07test: Leave tmp.<testname> for broken testsCarl Worth
Previously, this directory was only preserved for failing tests. But it's important to be able to easily debug known-broken tests, so preserve the actual vs. expected output for those as well.
2010-12-07Make author order tests more strict.Austin Clements
Use varying dates in the test messages to test the order authors are listed in. Add tests with repeated author names and unusual date ordering. Most of these are broken at the moment, but will be fixed shortly. Edited-by: Carl Worth <cworth@cworth.org>: Also update the expected results for existing emacs tests that currently codify the incorrect author ordering, (and similarly note them as broken in the current test suite).
2010-12-07Fix handling of broken tests.Austin Clements
Make sure to close the subtest for test_expect_equal_failure, just like in test_expect_equal.
2010-12-07emacs: Improve the display of truncated authors.David Edmondson
Incremental search does not match strings that span a visible/invisible boundary. This results in failure to correctly isearch for authors in `notmuch-search' mode if the name of the author is split between the visible and invisible components of the authors string. To avoid this, attempt to truncate the visible component of the authors string on a boundary between authors, such that the entirety of an author's name is either visible or invisible.
2010-12-07test: Ignore files created during test failures.David Edmondson
When a test fails, a tmp.<testname> file is left behind. These files are useful for the person debugging the test failure, but are never anything we want to commit. Edited-by: Carl Worth <cworth@cworth.org>: Changed from tmp.emacs to tmp.* and added explanation in the commit message.
2010-11-23test: Add --format=json testing to the "notmuch search --format" tests.Carl Worth
This testing *does* capture the bug of missing '[' and ']' characters int "notmuch search --output=tags" case. This is another manifestation of the same bug causing the missing final newline (as mentioned in the previous commit).
2010-11-23test: Add simple tests for "notmuch search --output=<>"Carl Worth
This code simply wasn't being exercised by the test suite before, so this will be useful. Meanwhile, there's currently a bug in "notmuch search --output=tags" in that it doesn't print a final newline. But the current test suite isn't able to catch this bug since the $() construct of the shell doesn't preserve the distinction of whether the final newline is present or not.