Re: [PATCH 9/9] add has: query prefix to search for specific properties
[notmuch-archives.git] / c1 / b6d16b7ce0a00aa6613fb03ec2c8b56a62c286
1 Return-Path: <pieter@praet.org>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id BAF3E41ED86\r
6         for <notmuch@notmuchmail.org>; Thu, 30 Jun 2011 01:23:32 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.7\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id nnmOuPYVYUc0 for <notmuch@notmuchmail.org>;\r
16         Thu, 30 Jun 2011 01:23:32 -0700 (PDT)\r
17 Received: from mail-wy0-f181.google.com (mail-wy0-f181.google.com\r
18         [74.125.82.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id B225C42119B\r
21         for <notmuch@notmuchmail.org>; Thu, 30 Jun 2011 01:23:31 -0700 (PDT)\r
22 Received: by wyh22 with SMTP id 22so1530868wyh.26\r
23         for <notmuch@notmuchmail.org>; Thu, 30 Jun 2011 01:23:30 -0700 (PDT)\r
24 Received: by 10.216.58.135 with SMTP id q7mr1556745wec.48.1309422210223;\r
25         Thu, 30 Jun 2011 01:23:30 -0700 (PDT)\r
26 Received: from localhost ([109.131.21.173])\r
27         by mx.google.com with ESMTPS id g2sm996338wes.34.2011.06.30.01.23.28\r
28         (version=TLSv1/SSLv3 cipher=OTHER);\r
29         Thu, 30 Jun 2011 01:23:29 -0700 (PDT)\r
30 From: Pieter Praet <pieter@praet.org>\r
31 To: notmuch@notmuchmail.org\r
32 Subject: [PATCH] test: stashing in notmuch-{show,search}\r
33 Date: Thu, 30 Jun 2011 10:23:23 +0200\r
34 Message-Id: <1309422203-24685-1-git-send-email-pieter@praet.org>\r
35 X-Mailer: git-send-email 1.7.4.1\r
36 In-Reply-To: <1309422050-23241-1-git-send-email-pieter@praet.org>\r
37 References: <1309422050-23241-1-git-send-email-pieter@praet.org>\r
38 X-BeenThere: notmuch@notmuchmail.org\r
39 X-Mailman-Version: 2.1.13\r
40 Precedence: list\r
41 List-Id: "Use and development of the notmuch mail system."\r
42         <notmuch.notmuchmail.org>\r
43 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
44         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
45 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
46 List-Post: <mailto:notmuch@notmuchmail.org>\r
47 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
48 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
49         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
50 X-List-Received-Date: Thu, 30 Jun 2011 08:23:32 -0000\r
51 \r
52 Should provide full test coverage of the stashing feature.\r
53 \r
54 Signed-off-by: Pieter Praet <pieter@praet.org>\r
55 ---\r
56  test/emacs                                |   41 +++++++++++++++++++++++++++++\r
57  test/emacs.expected-output/emacs-stashing |    9 ++++++\r
58  2 files changed, 50 insertions(+), 0 deletions(-)\r
59  create mode 100644 test/emacs.expected-output/emacs-stashing\r
60 \r
61 diff --git a/test/emacs b/test/emacs\r
62 index 53f455a..46076c6 100755\r
63 --- a/test/emacs\r
64 +++ b/test/emacs\r
65 @@ -347,4 +347,45 @@ test_emacs '(notmuch-show "id:f35dbb950911171438k5df6eb56k77b6c0944e2e79ae@mail.\r
66             (test-visible-output)'\r
67  test_expect_equal_file OUTPUT $EXPECTED/notmuch-show-thread-with-hidden-messages\r
68  \r
69 +test_begin_subtest "Stashing in notmuch-show"\r
70 +add_message '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' \\r
71 +    '[from]="Some One <someone@somewhere.org>"' \\r
72 +    '[to]="Some One Else <notsomeone@somewhere.org>"' \\r
73 +    '[cc]="Notmuch <notmuch@notmuchmail.org>"' \\r
74 +    '[subject]="Stash my stashables"' \\r
75 +    '[id]="bought"' \\r
76 +    '[body]="Unable to stash body. Where did you get it in the first place?!?"'\r
77 +notmuch tag +stashtest id:${gen_msg_id}\r
78 +test_emacs '(notmuch-show "id:\"bought\"")\r
79 +        (notmuch-show-stash-date)\r
80 +        (notmuch-show-stash-from)\r
81 +        (notmuch-show-stash-to)\r
82 +        (notmuch-show-stash-cc)\r
83 +        (notmuch-show-stash-subject)\r
84 +        (notmuch-show-stash-message-id)\r
85 +        (notmuch-show-stash-message-id-stripped)\r
86 +        (notmuch-show-stash-tags)\r
87 +        (notmuch-show-stash-filename)\r
88 +        (switch-to-buffer\r
89 +          (generate-new-buffer "*test-stashing*"))\r
90 +        (dotimes (i 9)\r
91 +          (yank)\r
92 +          (insert "\n")\r
93 +          (rotate-yank-pointer 1))\r
94 +        (reverse-region (point-min) (point-max))\r
95 +           (test-output)'\r
96 +sed -i -e 's/^.*tmp.emacs\/mail.*$/FILENAME/' OUTPUT\r
97 +test_expect_equal_file OUTPUT $EXPECTED/emacs-stashing\r
98 +\r
99 +test_begin_subtest "Stashing in notmuch-search"\r
100 +test_emacs '(notmuch-search "id:\"bought\"")\r
101 +        (notmuch-test-wait)\r
102 +        (notmuch-search-stash-thread-id)\r
103 +        (switch-to-buffer\r
104 +          (generate-new-buffer "*test-stashing*"))\r
105 +        (yank)\r
106 +           (test-output)'\r
107 +sed -i -e 's/^thread:.*$/thread:XXX/' OUTPUT\r
108 +test_expect_equal $(cat OUTPUT) "thread:XXX"\r
109 +\r
110  test_done\r
111 diff --git a/test/emacs.expected-output/emacs-stashing b/test/emacs.expected-output/emacs-stashing\r
112 new file mode 100644\r
113 index 0000000..4923594\r
114 --- /dev/null\r
115 +++ b/test/emacs.expected-output/emacs-stashing\r
116 @@ -0,0 +1,9 @@\r
117 +Sat, 01 Jan 2000 12:00:00 -0000\r
118 +Some One <someone@somewhere.org>\r
119 +Some One Else <notsomeone@somewhere.org>\r
120 +Notmuch <notmuch@notmuchmail.org>\r
121 +Stash my stashables\r
122 +id:"bought"\r
123 +bought\r
124 +inbox,stashtest\r
125 +FILENAME\r
126 -- \r
127 1.7.4.1\r
128 \r