[PATCH] test: add basic tests for notmuch new --quiet option
[notmuch-archives.git] / 0c / 7d2d6c6d05bcebb4033afead4baf9ecb0b5d3e
1 Return-Path: <jani@nikula.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 65499431FBD\r
6         for <notmuch@notmuchmail.org>; Sun, 26 Jan 2014 10:58:57 -0800 (PST)\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 3kvJxAvzRWqt for <notmuch@notmuchmail.org>;\r
16         Sun, 26 Jan 2014 10:58:51 -0800 (PST)\r
17 Received: from mail-ee0-f43.google.com (mail-ee0-f43.google.com\r
18  [74.125.83.43])        (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
19  certificate requested) by olra.theworths.org (Postfix) with ESMTPS id\r
20  4EB80431FBC    for <notmuch@notmuchmail.org>; Sun, 26 Jan 2014 10:58:51 -0800\r
21  (PST)\r
22 Received: by mail-ee0-f43.google.com with SMTP id c41so1864967eek.2\r
23         for <notmuch@notmuchmail.org>; Sun, 26 Jan 2014 10:58:48 -0800 (PST)\r
24 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
25         d=1e100.net; s=20130820;\r
26         h=x-gm-message-state:from:to:cc:subject:date:message-id;\r
27         bh=R/2HIf1LFjk7nWn6cbKy6JSAE1gNqu1Z7fWzLsP66lc=;\r
28         b=Tm4S8UlJQPNQmBolBnbjm498H1PvW+UUBK/0O95w805SagU3He/YRv653QsWFX25/v\r
29         dkc8KCo3AFFj05Dah1DF9FR+NDbbJIJQd+izkWZoXSayiUIHtV3OzmZ5uOuBMeyzNFjD\r
30         vv9ihjs/p4IFT9VaLZfN5vFG31Fpgjojz2b87XJOTMO+7uWO38FtJIz/jvn31vXIWOKS\r
31         QOQywoV4t7XDAnmc5Zbl/+gkGy5tkjzhpMgHkivM8JqYUU4HaJPbpUsr8Jm2QuqGvIfQ\r
32         nO2kjA3m/otvSOJSjibFKLgy9z6RliolEsKKDgYDRKyEvWl1kJyBuXI1e8SLj4j8khJr\r
33         g01w==\r
34 X-Gm-Message-State:\r
35  ALoCoQmEeOCKx+Hskg07JLzlcZhOHOPogToIfONdbpByZ2/5MlZafm5qYVbkP5cNp46urA83cmSX\r
36 X-Received: by 10.14.98.129 with SMTP id v1mr21515308eef.5.1390762728723;\r
37         Sun, 26 Jan 2014 10:58:48 -0800 (PST)\r
38 Received: from localhost (dsl-hkibrasgw2-58c36f-91.dhcp.inet.fi.\r
39         [88.195.111.91])\r
40         by mx.google.com with ESMTPSA id m1sm10745946een.7.2014.01.26.10.58.47\r
41         for <multiple recipients>\r
42         (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
43         Sun, 26 Jan 2014 10:58:48 -0800 (PST)\r
44 From: Jani Nikula <jani@nikula.org>\r
45 To: notmuch@notmuchmail.org\r
46 Subject: [PATCH] test: add basic tests for notmuch new --quiet option\r
47 Date: Sun, 26 Jan 2014 20:58:46 +0200\r
48 Message-Id: <1390762726-14075-1-git-send-email-jani@nikula.org>\r
49 X-Mailer: git-send-email 1.8.5.2\r
50 X-BeenThere: notmuch@notmuchmail.org\r
51 X-Mailman-Version: 2.1.13\r
52 Precedence: list\r
53 List-Id: "Use and development of the notmuch mail system."\r
54         <notmuch.notmuchmail.org>\r
55 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
56         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
57 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
58 List-Post: <mailto:notmuch@notmuchmail.org>\r
59 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
60 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
61         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
62 X-List-Received-Date: Sun, 26 Jan 2014 18:58:57 -0000\r
63 \r
64 This does not cover all the possible paths notmuch new could output\r
65 stuff, but it's better than nothing.\r
66 ---\r
67  test/T050-new.sh | 15 +++++++++++++++\r
68  1 file changed, 15 insertions(+)\r
69 \r
70 diff --git a/test/T050-new.sh b/test/T050-new.sh\r
71 index f27423d..b7668ff 100755\r
72 --- a/test/T050-new.sh\r
73 +++ b/test/T050-new.sh\r
74 @@ -248,4 +248,19 @@ ln -s i_do_not_exist "${MAIL_DIR}"/broken_link\r
75  output=$(NOTMUCH_NEW 2>&1)\r
76  test_expect_equal "$output" "No new mail."\r
77  \r
78 +test_begin_subtest "Quiet: No new mail."\r
79 +output=$(NOTMUCH_NEW --quiet)\r
80 +test_expect_equal "$output" ""\r
81 +\r
82 +test_begin_subtest "Quiet: new, removed and renamed messages."\r
83 +# new\r
84 +generate_message\r
85 +# deleted\r
86 +notmuch search --format=text0 --output=files --limit=1 '*' | xargs -0 rm\r
87 +# moved\r
88 +mkdir "${MAIL_DIR}"/moved_messages\r
89 +notmuch search --format=text0 --output=files --offset=1 --limit=1 '*' | xargs -0 -I {} mv {} "${MAIL_DIR}"/moved_messages\r
90 +output=$(NOTMUCH_NEW --quiet)\r
91 +test_expect_equal "$output" ""\r
92 +\r
93  test_done\r
94 -- \r
95 1.8.5.2\r
96 \r