--- /dev/null
+Return-Path: <amdragon@mit.edu>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id CB8E6431FC0\r
+ for <notmuch@notmuchmail.org>; Tue, 30 Oct 2012 19:29:35 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+ tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id AopNwPL23Sd6 for <notmuch@notmuchmail.org>;\r
+ Tue, 30 Oct 2012 19:29:35 -0700 (PDT)\r
+Received: from dmz-mailsec-scanner-4.mit.edu (DMZ-MAILSEC-SCANNER-4.MIT.EDU\r
+ [18.9.25.15])\r
+ by olra.theworths.org (Postfix) with ESMTP id 1E048431FAF\r
+ for <notmuch@notmuchmail.org>; Tue, 30 Oct 2012 19:29:35 -0700 (PDT)\r
+X-AuditID: 1209190f-b7f636d00000095b-a8-50908d0e95ff\r
+Received: from mailhub-auth-3.mit.edu ( [18.9.21.43])\r
+ by dmz-mailsec-scanner-4.mit.edu (Symantec Messaging Gateway) with SMTP\r
+ id FF.90.02395.E0D80905; Tue, 30 Oct 2012 22:29:34 -0400 (EDT)\r
+Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
+ by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id q9V2TWNo001666; \r
+ Tue, 30 Oct 2012 22:29:33 -0400\r
+Received: from drake.dyndns.org\r
+ (209-6-116-242.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com\r
+ [209.6.116.242]) (authenticated bits=0)\r
+ (User authenticated as amdragon@ATHENA.MIT.EDU)\r
+ by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q9V2TTIG027163\r
+ (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
+ Tue, 30 Oct 2012 22:29:31 -0400 (EDT)\r
+Received: from amthrax by drake.dyndns.org with local (Exim 4.77)\r
+ (envelope-from <amdragon@mit.edu>)\r
+ id 1TTO3X-00021O-Ri; Tue, 30 Oct 2012 22:29:23 -0400\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 1/2] test: Test buttonization of id: links\r
+Date: Tue, 30 Oct 2012 22:29:20 -0400\r
+Message-Id: <1351650561-7331-2-git-send-email-amdragon@mit.edu>\r
+X-Mailer: git-send-email 1.7.10\r
+In-Reply-To: <1351650561-7331-1-git-send-email-amdragon@mit.edu>\r
+References: <1351650561-7331-1-git-send-email-amdragon@mit.edu>\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFtrFIsWRmVeSWpSXmKPExsUixCmqrcvXOyHAYPdaVYum6c4W12/OZHZg\r
+ 8rh1/zW7x7NVt5gDmKK4bFJSczLLUov07RK4Ms7te8Ze8Emo4t+tRsYGxsv8XYycHBICJhKf\r
+ TnxlgrDFJC7cW8/WxcjFISSwj1Fi6+LFrCAJIYENjBJ/9mZDJB4xSfSt62GHcOYySny4e5UZ\r
+ pIpNQENi2/7ljCC2iIC0xM67s4G6OTiYBcwlbrbEgYSFBawkzu9bwgZiswioSlxYegWsnFfA\r
+ XuLslj1sEFfISzy93wdmcwo4SDzdupYRZIwQUM3tlxITGPkXMDKsYpRNya3SzU3MzClOTdYt\r
+ Tk7My0st0jXRy80s0UtNKd3ECA4iSf4djN8OKh1iFOBgVOLh1fjeHyDEmlhWXJl7iFGSg0lJ\r
+ lLeoa0KAEF9SfkplRmJxRnxRaU5q8SFGCQ5mJRHeixlAOd6UxMqq1KJ8mJQ0B4uSOO/VlJv+\r
+ QgLpiSWp2ampBalFMFkZDg4lCV7NHqBGwaLU9NSKtMycEoQ0EwcnyHAeoOER3SDDiwsSc4sz\r
+ 0yHypxgVpcR534AkBEASGaV5cL2wKH/FKA70ijCvC8gKHmCCgOt+BTSYCWiwDl8vyOCSRISU\r
+ VAOjiuAawVNCVR6Rb3QuW+fmtHj8/iOufEH+RP060be+kTO5yiNaVZmNrV4YsP5nXbv+s6T7\r
+ JzuRV54xS8P2R5btFDPYt//eq12L/6b8dem3/bjQ5GZ82Zx1N4Rn7fr7f16mHVPKCTNuidaH\r
+ /4MKHK02Pubg0il5t+NFfOmMrGvTAoJFLaokv3gpsRRnJBpqMRcVJwIAS8hqks0CAAA=\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Wed, 31 Oct 2012 02:29:36 -0000\r
+\r
+This matches the current behavior of the buttonizer, so it passes, but\r
+many of these cases are not what you'd want (and some of them aren't\r
+even valid Xapian queries). The next patch will fix the handling of\r
+these cases and update the test.\r
+---\r
+ test/emacs-show | 40 ++++++++++++++++++++++++++++++++++++++++\r
+ test/test-lib.el | 14 ++++++++++++++\r
+ 2 files changed, 54 insertions(+)\r
+\r
+diff --git a/test/emacs-show b/test/emacs-show\r
+index 64c38d3..c4f3cf4 100755\r
+--- a/test/emacs-show\r
++++ b/test/emacs-show\r
+@@ -106,5 +106,45 @@ test_emacs '(notmuch-search "from:lars@seas.harvard.edu and subject:\"Maildir st\r
+ (test-visible-output)'\r
+ test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-indent-thread-content-off\r
+ \r
++test_begin_subtest "id buttonization"\r
++add_message '[body]="\r
++id:abc\r
++id:abc.def. id:abc,def, id:abc;def;\r
++id:abc)def\r
++id:ab\"c def\r
++id:\"abc\"def\r
++id:\"ab\"\"c\"def\r
++id:\"ab c\"def\r
++id:\"abc\".def\r
++id:\"abc\r
++\"\r
++id:)\r
++id:\r
++cid:xxx"'\r
++test_emacs '(notmuch-show "id:'$gen_msg_id'")\r
++ (notmuch-test-mark-links)\r
++ (test-visible-output)'\r
++cat <<EOF >EXPECTED\r
++Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-05) (inbox)\r
++Subject: id buttonization\r
++To: Notmuch Test Suite <test_suite@notmuchmail.org>\r
++Date: Fri, 05 Jan 2001 15:43:57 +0000\r
++\r
++<<id:abc>>\r
++<<id:abc.def.>> <<id:abc,def,>> <<id:abc;def;>>\r
++<<id:abc)def>>\r
++<<id:ab>>"c def\r
++<<id:"abc">>def\r
++<<id:"ab">>"c"def\r
++id:"ab c"def\r
++<<id:"abc">>.def\r
++id:"abc\r
++"\r
++<<id:)>>\r
++id:\r
++c<<id:xxx>>\r
++EOF\r
++test_expect_equal_file OUTPUT EXPECTED\r
++\r
+ \r
+ test_done\r
+diff --git a/test/test-lib.el b/test/test-lib.el\r
+index fa3380c..dece811 100644\r
+--- a/test/test-lib.el\r
++++ b/test/test-lib.el\r
+@@ -107,6 +107,20 @@ nothing."\r
+ (ad-set-arg 1 (char-to-string char))\r
+ ad-do-it))))\r
+ \r
++(defun notmuch-test-mark-links ()\r
++ "Enclose links in the current buffer with << and >>."\r
++ ;; Links are often created by jit-lock functions\r
++ (jit-lock-fontify-now)\r
++ (save-excursion\r
++ (let ((inhibit-read-only t))\r
++ (goto-char (point-min))\r
++ (let ((button))\r
++ (while (setq button (next-button (point)))\r
++ (goto-char (button-start button))\r
++ (insert "<<")\r
++ (goto-char (button-end button))\r
++ (insert ">>"))))))\r
++\r
+ (defmacro notmuch-test-run (&rest body)\r
+ "Evaluate a BODY of test expressions and output the result."\r
+ `(with-temp-buffer\r
+-- \r
+1.7.10\r
+\r