Commit graph

48 commits

Author SHA1 Message Date
Michael J Gruber
aec72e5806 test: make T450 independent of application/octet-stream interpretation
The actual content type of `application/octet-stream` is up to content
type detection of the reader, and thus may not be stable across
implementations or versions. This showed up when

fd46fc19 ("emacs:  document/defcustom notmuch-multipart/alternative-discouraged", 2022-05-14)

introduced a test for omitting a part of type `text/html` because it
expected a part of type `application/octet-stream` to remain in place,
i.e. a part of "unstable type". In particular, tests with `fd46fc19`
would succeed on RHEL/EPEL but fail on all current Fedoras with

```
 FAIL   multipart/alternative hides html by default
	--- T450-emacs-show.16.notmuch-show-multipart-alternative	2022-05-26 15:34:42.100557244 +0000
	+++ T450-emacs-show.16.OUTPUT	2022-05-26 15:34:42.102557207 +0000
	@@ -24,7 +24,7 @@
	 uses 64 as the
	 buffer size.
	 [ text/html (hidden) ]
	-[ 0001-Deal-with-situation-where-sysconf-_SC_GETPW_R_SIZE_M.patch: application/octet-stream (as text/x-diff) ]
	+[ 0001-Deal-with-situation-where-sysconf-_SC_GETPW_R_SIZE_M.patch: application/octet-stream (as text/x-patch) ]
	 From e3bc4bbd7b9d0d086816ab5f8f2d6ffea1dd3ea4 Mon Sep 17 00:00:00 2001
	 From: Alexander Botero-Lowry <alex.boterolowry@gmail.com>
	 Date: Tue, 17 Nov 2009 11:30:39 -0800
```

due to the different type detected.

Fix this by giving that message a specicific type of `text/x-diff` in
the test corpus, and adjust all affected test outputs.

Signed-off-by: Michael J Gruber <git@grubix.eu>
Amended-by: db, fix some trailing whitespace
2022-05-29 07:23:32 -03:00
David Bremner
68640fd967 Revert "emacs: use --exclude=false when checking for empty searches"
Revert commit 8370e3cfe2, and remark the
corresponding test as broken. Also update the expected output of the
broken test to show excludes active in the user defined saved searches.
2022-01-23 14:21:46 -04:00
David Bremner
704aa76f5d test/emacs: add known broken test for hidden tags
Gregor Zattler observed that tags could be unintentionally hidden in
the "All tags" view, and Tomi Ollia worked out [2] that the issue was tags
that only occured on excluded messages. This test reproduces that bug.

[1]: id:87wox1vovj.fsf@len.workgroup
[2]: id:m28t9faaim.fsf@guru.guru-group.fi
2022-01-20 15:31:29 -04:00
David Bremner
dc8262bd33 test/emacs: test for functions in notmuch-search-result-format.
Based on the commit message in id:20210221151902.2301690-3-dme@dme.org

Add the function notmuch-test-result-flags to test-lib.el to avoid
repeating it in 3 T*.sh files.
2021-09-08 23:01:02 -03:00
David Bremner
f1bcb6b7c2 emacs: change default for notmuch-crypto-process-mime to t
There are some cases like remote usage where this might cause
problems, but those users can easily customize the variable. The
inconvenience seems to be outweighed by the security benefit for most
users.
2017-07-15 09:11:32 -03:00
Mark Walters
999d473299 emacs: wash: word-wrap bugfix
Previously notmuch-wash made the width of the text (approximately) the
window-width minus the depth in thread. This is correct for the
default indentation of 1 per message depth, but is incorrect for any
other setting of notmuch-show-indent-messages-width.

As notmuch-show-indent-messages-width is customisable, and notmuch-tree
sets it to zero to avoid indenting messages in the message pane, this
bug can show up in real use.

Two of the tests had to be updated: when
notmuch-show-indent-messages-width is 0, then the new (correct) word
wrapping happens later, when notmuch-show-indent-messages-width is 4,
then the new word wrapping happens sooner.
2016-08-09 09:34:25 +09:00
David Edmondson
f8effea9a3 emacs: Always insert crypto buttons.
When no decryption or signature examination is
happening (i.e. `notmuch-crypto-process-mime' is `nil') insert buttons
that indicate this, rather than remaining silent.
2016-04-10 20:46:58 -03:00
Jani Nikula
b8a136187a emacs: hello: promote '?' as the universal help key
Move the brief help text at the bottom of the hello screen to the
notmuch-hello-mode help, and promote '?' as the universal help key
across Notmuch. This unclutters the hello screen, and allows for a
more verbose description in the mode help. Hopefully, this change is
useful for both experienced and new users alike.

While at it, improve the links to Notmuch and hello screen
customization.
2016-03-14 19:54:32 -03:00
Austin Clements
e501a16e71 emacs: Expand default saved searches and add shortcut keys
This should help new users off to a better start with the addition of
more sensible saved searches and default shortcut keys.  Most existing
users have probably customized this variable and won't be affected.
2014-08-05 08:07:52 -03:00
Pieter Praet
f5aa5ac6c7 test: emacs: new tests "notmuch-show: {, un}collapse all messages in thread"
* test/emacs:

  - New subtest "notmuch-show: collapse all messages in thread":
    `notmuch-show-open-or-close-all' with prefix arg ("C-u M-RET")
    collapses all messages in thread.

  - New subtest "notmuch-show: uncollapse all messages in thread":
    `notmuch-show-open-or-close-all' without prefix arg ("M-RET")
    uncollapses all messages in thread.
2012-10-20 12:10:24 -03:00
Pieter Praet
3a8712e7db test: emacs: new tests "notmuch-show: {show, hide} message headers"
* test/emacs:

  - New subtest "notmuch-show: show message headers":
    Setting `notmuch-message-headers-visible' to t causes all headers
    defined in `notmuch-message-headers' to be shown.

  - New subtest "notmuch-show: hide message headers":
    Setting `notmuch-message-headers-visible' to nil causes all headers
    defined in `notmuch-message-headers' to be hidden.
    ("Subject:" may be an exception;  See the use of `headers-start' in
    `notmuch-show-insert-msg')

  - New subtest "notmuch-show: hide message headers (w/ notmuch-show-toggle-headers)":
    Setting `notmuch-message-headers-visible' to t causes all headers
    defined in `notmuch-message-headers' to be shown, but they can be
    hidden for the current message by running `notmuch-show-toggle-headers'.
2012-10-20 12:10:12 -03:00
Ethan Glasser-Camp
518eed1ba7 test: Move tests from emacs to emacs-show
This requires changing the contents of the crypto tests, as one thread
that was marked read by the earlier tests in test/emacs is no longer
marked read.

This moves tests for:

- 09d19ac "test: emacs: toggle eliding of non-matching messages in
   `notmuch-show'", which should have actually read: "test: emacs:
   toggle processing of cryptographic MIME parts in `notmuch-show'".
   See commit 19ec74c5.

- 5ea1dbe "test: emacs: toggle eliding of non-matching messages in
  `notmuch-show'"

- 345faab "test: emacs: toggle thread content indentation in
  `notmuch-show'"

Signed-off-by: Ethan Glasser-Camp <ethan@betacantrips.com>
2012-10-18 08:45:16 -03:00
Pieter Praet
345faab1f5 test: emacs: toggle thread content indentation in `notmuch-show'
See commit c205e8ff.
2012-10-17 21:35:38 -03:00
Pieter Praet
5ea1dbe977 test: emacs: toggle eliding of non-matching messages in `notmuch-show'
See commits 44a544ed, 866ce8b1, 668b66ec.
2012-10-17 21:33:44 -03:00
Pieter Praet
09d19ac8c0 test: emacs: toggle eliding of non-matching messages in `notmuch-show'
See commits 44a544ed, 866ce8b1, 668b66ec.

Signed-off-by: Ethan Glasser-Camp <ethan@betacantrips.com>
2012-10-17 21:31:13 -03:00
Dmitry Kurochkin
512df7ec47 test: add Emacs notmuch-hello tests for custom tags and queries section.
The tests use default values from customization widgets to make sure
that these customization widgets work (at least on basic level).

The custom queries section test is currently broken.
2012-05-06 19:44:42 -03:00
Dmitry Kurochkin
6409a27b2c emacs: get rid of trailing spaces in notmuch-hello view
This patch removes trailing spaces in notmuch-hello view.

A side effect of this change is that tag/query buttons no longer
include a space at the end.  This means that pressing RET when the
point is at the first character after the tag/query button no longer
works (note that this is the standard behavior for buttons).  We may
change this behavior in the future (without adding trailing spaces
back) if people would find this change inconvenient.
2012-04-12 08:40:33 -03:00
Dmitry Kurochkin
1361dd37bc emacs: fix off-by-one error in notmuch-hello column alignment
Expected results for few tests are fixed, the relevant test is
unmarked broken.
2012-04-05 07:40:12 -03:00
Dmitry Kurochkin
818790f7b5 test: add broken test for long names in Emacs notmuch-hello view
Currently, the column alignment in Emacs notmuch-hello is broken for
tags/queries with long names.
2012-04-05 07:37:53 -03:00
Daniel Schoepe
6e25ea031f emacs: Tests for user-defined sections
A new file was added for notmuch-hello tests.
2012-03-01 08:16:55 -04:00
Dmitry Kurochkin
d0a048f856 emacs: polish notmuch-hello help text
Make `=' binding description consistent with others.
2012-01-26 08:20:40 -04:00
Dmitry Kurochkin
02d8815922 emacs: bind "s" to `notmuch-search' in notmuch-hello buffer
Before the change, "s" in notmuch-hello buffer would jump to the
search box.  The patch changes the binding to `notmuch-search' which
is consistent with all other notmuch buffers.
2012-01-25 08:33:27 -04:00
Dmitry Kurochkin
d3aa6848da emacs: add invisible dot instead of space at the end of notmuch-hello search box
This makes `show-trailing-whitespace' happy, i.e. it does not mark the
whole search box line as trailing spaces.

Since the dot is invisible, this change makes no visible difference
for `notmuch-hello'.

Edited-by: Pieter Praet <pieter@praet.org> to fix the tests.
2012-01-21 08:50:48 -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 Edmondson
c96f5f29dd test: Updated the expected output to match the newly enabled text/plain hooks. 2011-12-28 13:29:08 -04:00
Gregor Zattler
629dbac626 emacs: test notmuch show with fourfold message indentation
Previous behaviour was to indent messages in a thread according
to depth by one space per level.  This commit tests if setting
notmuch-indent-messages-width to `4' provides a message thread
with four spaces of indentation thread depth.
2011-11-25 12:41:59 -05:00
Gregor Zattler
06156f70bf emacs: test: notmuch show without indentation
Previous behaviour was to indent messages in a thread according
to depth by one space per level.  In
id:1311028119-50637-1-git-send-email-fgeller@gmail.com Felix
Geller proposed a patch in order to turn indentation off.  This
commit tests if instead setting notmuch-indent-messages-width to
`0' does turn off indentation.
2011-11-25 12:41:43 -05:00
Pieter Praet
66247d26f3 test: emacs: tidy up "Stashing in notmuch-show" test
Merge expected output into the actual test, so we can verify the stashed
filename using ${gen_msg_filename} instead of doing sed tricks.
2011-11-18 13:29:35 -05:00
Pieter Praet
64febdf71c test: stashing in notmuch-{show,search}
Should provide full test coverage of the stashing feature.

Signed-off-by: Pieter Praet <pieter@praet.org>
2011-11-12 20:32:47 -04:00
Dmitry Kurochkin
e972d752c0 emacs: add invisible space after the search widget field in notmuch-hello
It is very convenient when C-e (bound to `widget-end-of-line') ignores
trailing spaces inside the search widget.  But it only does so if a
widget is not followed by a newline (that is why it works in the saved
search widgets).  The patch just adds an invisible space after the
search widget to get the desirable behavior of `widget-end-of-line'.
The extra space is also added to expected results of emacs tests.
2011-11-12 10:34:53 -05:00
Carl Worth
580de27177 emacs: Fix to unconditionally display subject changes in collapsed thread view
The feature to show subject changes in the collapsed thread view was
originally added (8ab433607) with an option
(notmuch-show-always-show-subject) to display the subject
for all messages, even when there was no change.

The subsequent commit (4f04d273) changed the sense of the test (or to
and) and the name of the controlling variable
(notmuch-show-elide-same-subject).

But this commit is broken in a few ways:

  1. The original definition of notmuch-show-always-show-subject was
     left around

     But the variable isn't actually used in the code at all, so it
     just adds clutter and confusion to the customization interface.

  2. The name and description of the controlling variable doesn't
     match the implementation

     The name suggests that setting the variable to t will cause
     repeated subjects to be elided, (suggesting that when it is nil
     all subjects will be shown).

     However, when the variable is nil, no subjects are shown. So a
     correct name for the variable in this sense would be
     notmuch-show-subject-changes.

Showing subject changes is a useful feature, and should be on by
default. (We don't want to bury generally useful features behind
customizations that users have to find).

Rather than fixing the name of the variable and changing its default
value, here we remove the condition entirely, such that the feature is
enabled unconditionally.

So both the currently-used variable and the stale definition of the
formerly-used are removed.

Also, the one relevant test-suite result is updated, (showing the
intial subject of a collapsed thread, and no subject display for later
messages that do not change the subject).
2011-07-01 02:00:25 -07:00
Dmitry Kurochkin
59b251ef94 test emacs: Add tests for hiding messages in notmuch-show view
This test is expected to fail as it exposes a current bug, (which we
hope to fix soon).
2011-06-15 07:07:32 -07:00
Jameson Graef Rollins
5b0bf70faa test: update emacs test to use test_expect_equal_file
This is a much cleaner way to do the emacs tests, since we're actually
comparing output against existing files with expected output.  We also
won't miss any trailing newlines this way.

And speaking of which, one of the expected output files was actually
missing a trailing blank line that was actually in one of the original
messages, so this was fixed.
2011-06-03 14:29:05 -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
Dmitry Kurochkin
d32b8b1715 test: fix expected output for emacs tests after the wash button label changes 2011-05-24 15:28:44 -07:00
David Edmondson
0898cfad5e emacs: Show cleaner `From:' addresses in the summary line.
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-18 16:11:53 -07:00
Carl Worth
c51d5b3cdb notmuch show: Include output for the enclosing multipart part of a MIME mail
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-17 14:51:06 -07:00
Austin Clements
a18a15326c Make author order tests more strict.
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-07 16:21:35 -08:00
David Edmondson
5d05d5434d emacs: Improve the display of truncated authors.
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-07 13:57:05 -08:00
Carl Worth
42f1a13374 test: Update emacs tests for fix to counting of signature lines.
The recent bug fix invalidated some expected test results. Fix them up.
2010-11-11 17:00:15 -08:00
Carl Worth
f8007ecb29 test: Add test for viewing raw message within emacs.
This provides further coverage for the recently added (and recently
modified) use of "notmuch show --format=raw" within emacs.
2010-11-06 14:33:30 -07:00
Carl Worth
581ea7c8d3 test: Add test for saving an attachment from emacs
This tests the use of "notmuch cat" recently added to the emacs
interface.
2010-11-06 11:25:56 -07:00
Carl Worth
484639453a test: Update mail corpus with original mails (with attachments).
The original mails used to pupulate the mail corpus had had their
attachments (obnoxiously) scrubbed by the pipermail mail archiver.
Since we actually want to test the handling of attachments, this is
less than useful. Restore these files from my own collection, (with
some Received and similar headers pruned).
2010-11-05 17:19:51 -07:00
Carl Worth
2d4b3e3348 test: Clear the "BROKEN" flag on an existing emacs test
I still don't know everything about how I want search order to be
customizable, but I do like the current defaults, (namely, performing
a new search gives results newest first, but performing a saved search
like "tag:inbox" gives results as oldest first).

Until we come up with a better plan for people to select what *they*
want, (rather than just getting what I want), let's codify the current
results in the test suite.
2010-11-05 17:19:51 -07:00
Carl Worth
3fe90a955e test: Test emacs notmuch-hello with no saved searches to display.
Haippily, this works just fine, but we might as well test that.
2010-10-29 15:53:34 -07:00
Carl Worth
dec2d57fbc test: Test emacs notmuch-hello when displaying a saved search with 0 results.
This test verifies that the bug fix in the previous commit is working.
2010-10-29 15:50:42 -07:00
Carl Worth
4884f5496c test: Avoid using unreliable, hard-coded thread ID values in test suite.
Some recently-added tests used hard-coded thread ID values in search
specifications. This is unreliable since the thread IDs depend on the
order in which "notmuch new" encounters new files, (which in turn can
depend on inode ordering within the filesystem).

Fix these by using the new "notmuch search --output=threads" to find the
correct thread IDs given a hard-coded (but reliable) message ID.
2010-10-28 11:45:50 -07:00
Carl Worth
4bb1b1603c test: Add tests for emacs notmuch-search and notmuch-show functions.
Moving the expected output into individual files (rather than inline)
to keep the test script much easier to read.
2010-10-22 16:58:35 -07:00