[PATCH] test: add basic tests for notmuch new --quiet option
authorJani Nikula <jani@nikula.org>
Sun, 26 Jan 2014 18:58:46 +0000 (20:58 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:59:24 +0000 (09:59 -0800)
0c/7d2d6c6d05bcebb4033afead4baf9ecb0b5d3e [new file with mode: 0644]

diff --git a/0c/7d2d6c6d05bcebb4033afead4baf9ecb0b5d3e b/0c/7d2d6c6d05bcebb4033afead4baf9ecb0b5d3e
new file mode 100644 (file)
index 0000000..118fe22
--- /dev/null
@@ -0,0 +1,96 @@
+Return-Path: <jani@nikula.org>\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 65499431FBD\r
+       for <notmuch@notmuchmail.org>; Sun, 26 Jan 2014 10:58:57 -0800 (PST)\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 3kvJxAvzRWqt for <notmuch@notmuchmail.org>;\r
+       Sun, 26 Jan 2014 10:58:51 -0800 (PST)\r
+Received: from mail-ee0-f43.google.com (mail-ee0-f43.google.com\r
+ [74.125.83.43])       (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
+ certificate requested)        by olra.theworths.org (Postfix) with ESMTPS id\r
+ 4EB80431FBC   for <notmuch@notmuchmail.org>; Sun, 26 Jan 2014 10:58:51 -0800\r
+ (PST)\r
+Received: by mail-ee0-f43.google.com with SMTP id c41so1864967eek.2\r
+       for <notmuch@notmuchmail.org>; Sun, 26 Jan 2014 10:58:48 -0800 (PST)\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+       d=1e100.net; s=20130820;\r
+       h=x-gm-message-state:from:to:cc:subject:date:message-id;\r
+       bh=R/2HIf1LFjk7nWn6cbKy6JSAE1gNqu1Z7fWzLsP66lc=;\r
+       b=Tm4S8UlJQPNQmBolBnbjm498H1PvW+UUBK/0O95w805SagU3He/YRv653QsWFX25/v\r
+       dkc8KCo3AFFj05Dah1DF9FR+NDbbJIJQd+izkWZoXSayiUIHtV3OzmZ5uOuBMeyzNFjD\r
+       vv9ihjs/p4IFT9VaLZfN5vFG31Fpgjojz2b87XJOTMO+7uWO38FtJIz/jvn31vXIWOKS\r
+       QOQywoV4t7XDAnmc5Zbl/+gkGy5tkjzhpMgHkivM8JqYUU4HaJPbpUsr8Jm2QuqGvIfQ\r
+       nO2kjA3m/otvSOJSjibFKLgy9z6RliolEsKKDgYDRKyEvWl1kJyBuXI1e8SLj4j8khJr\r
+       g01w==\r
+X-Gm-Message-State:\r
+ ALoCoQmEeOCKx+Hskg07JLzlcZhOHOPogToIfONdbpByZ2/5MlZafm5qYVbkP5cNp46urA83cmSX\r
+X-Received: by 10.14.98.129 with SMTP id v1mr21515308eef.5.1390762728723;\r
+       Sun, 26 Jan 2014 10:58:48 -0800 (PST)\r
+Received: from localhost (dsl-hkibrasgw2-58c36f-91.dhcp.inet.fi.\r
+       [88.195.111.91])\r
+       by mx.google.com with ESMTPSA id m1sm10745946een.7.2014.01.26.10.58.47\r
+       for <multiple recipients>\r
+       (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
+       Sun, 26 Jan 2014 10:58:48 -0800 (PST)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] test: add basic tests for notmuch new --quiet option\r
+Date: Sun, 26 Jan 2014 20:58:46 +0200\r
+Message-Id: <1390762726-14075-1-git-send-email-jani@nikula.org>\r
+X-Mailer: git-send-email 1.8.5.2\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: Sun, 26 Jan 2014 18:58:57 -0000\r
+\r
+This does not cover all the possible paths notmuch new could output\r
+stuff, but it's better than nothing.\r
+---\r
+ test/T050-new.sh | 15 +++++++++++++++\r
+ 1 file changed, 15 insertions(+)\r
+\r
+diff --git a/test/T050-new.sh b/test/T050-new.sh\r
+index f27423d..b7668ff 100755\r
+--- a/test/T050-new.sh\r
++++ b/test/T050-new.sh\r
+@@ -248,4 +248,19 @@ ln -s i_do_not_exist "${MAIL_DIR}"/broken_link\r
+ output=$(NOTMUCH_NEW 2>&1)\r
+ test_expect_equal "$output" "No new mail."\r
\r
++test_begin_subtest "Quiet: No new mail."\r
++output=$(NOTMUCH_NEW --quiet)\r
++test_expect_equal "$output" ""\r
++\r
++test_begin_subtest "Quiet: new, removed and renamed messages."\r
++# new\r
++generate_message\r
++# deleted\r
++notmuch search --format=text0 --output=files --limit=1 '*' | xargs -0 rm\r
++# moved\r
++mkdir "${MAIL_DIR}"/moved_messages\r
++notmuch search --format=text0 --output=files --offset=1 --limit=1 '*' | xargs -0 -I {} mv {} "${MAIL_DIR}"/moved_messages\r
++output=$(NOTMUCH_NEW --quiet)\r
++test_expect_equal "$output" ""\r
++\r
+ test_done\r
+-- \r
+1.8.5.2\r
+\r