unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Thomas Schwinge <thomas@schwinge.name>
To: notmuch@notmuchmail.org
Cc: Thomas Schwinge <thomas@schwinge.name>
Subject: [PATCH 1/2] New test: Emacs' forgetfulness.
Date: Thu,  3 Feb 2011 00:56:38 +0100	[thread overview]
Message-ID: <1296690999-16542-2-git-send-email-thomas@schwinge.name> (raw)
In-Reply-To: <87zkqeiffj.fsf@kepler.schwinge.homeip.net>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1886 bytes --]

Signed-off-by: Thomas Schwinge <thomas@schwinge.name>
---
 test/emacs-forgetfulness |   38 ++++++++++++++++++++++++++++++++++++++
 test/notmuch-test        |    1 +
 2 files changed, 39 insertions(+), 0 deletions(-)
 create mode 100755 test/emacs-forgetfulness

diff --git a/test/emacs-forgetfulness b/test/emacs-forgetfulness
new file mode 100755
index 0000000..e17b26f
--- /dev/null
+++ b/test/emacs-forgetfulness
@@ -0,0 +1,38 @@
+#!/bin/bash
+
+test_description=Emacs\'\ forgetfulness
+
+. test-lib.sh
+
+# RFC822 imposes a 998 character limit per line.
+x=0123456789 # 10
+x=$x$x$x$x$x$x$x$x$x$x # 100
+x=$x$x$x$x$x$x$x$x$x # 900
+
+# If setting this ``too high'' (TODO: yet to be determined), Emacs will crash
+# with a segmentation fault.
+n=20
+for i in $(seq 1 $n); do
+  # Roughly 2 KiB per message.  That is, we need two messages in order to
+  # exceed the typical size of the pipe buffer (4 KiB on commodity systems).
+  generate_message [subject]=$i-$x [from]=$i-$x@x.x
+done
+# With 20 messages à 2 KiB, we have about 10 full pipe buffers, which should be
+# enough to trigger the erroneous behavior.
+
+notmuch new > /dev/null
+
+test_begin_subtest 'Search for all messages'
+output=$(exec 2>&1; \
+         diff -wu \
+           <(notmuch search \* \
+               | sed \
+                   -e 's%^thread:[0-9a-f]*\ %%' \
+                   -e 's%;%%'; \
+             echo 'End of search results.'; \
+             echo) \
+           <(test_emacs 2>&1 \
+               '(notmuch-search "*") (notmuch-test-wait) (message (buffer-string))'))
+test_expect_equal "$output" ''
+
+test_done
diff --git a/test/notmuch-test b/test/notmuch-test
index 9d77c0f..2f11eac 100755
--- a/test/notmuch-test
+++ b/test/notmuch-test
@@ -36,6 +36,7 @@ TESTS="
   encoding
   emacs
   maildir-sync
+  emacs-forgetfulness
 "
 
 # Clean up any results from a previous run
-- 
1.7.1

  parent reply	other threads:[~2011-02-02 23:58 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-30 21:02 [BUG] Emacs UI dropping every 25th line, roughly Thomas Schwinge
2011-01-30 21:14 ` Jesse Rosenthal
2011-02-02 16:12 ` Thomas Schwinge
2011-02-02 23:56   ` Thomas Schwinge
2011-02-02 23:56   ` Thomas Schwinge [this message]
2011-02-02 23:56   ` [PATCH 2/2] notmuch.el:notmuch-search-process-filter: Rewritten. Cope with incomplete lines Thomas Schwinge
2011-02-03 17:06     ` Austin Clements
2011-02-03 17:27       ` Thomas Schwinge
2011-03-11  2:09       ` Carl Worth
2011-03-11  2:02     ` Carl Worth
2011-11-15 11:34       ` Thomas Schwinge
2013-06-24 22:43         ` Austin Clements

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1296690999-16542-2-git-send-email-thomas@schwinge.name \
    --to=thomas@schwinge.name \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).