From 744997d9959fb26f2e24534d0f2d255f8701c4cd Mon Sep 17 00:00:00 2001 From: Jani Nikula Date: Sun, 26 Jan 2014 20:58:46 +0200 Subject: [PATCH] [PATCH] test: add basic tests for notmuch new --quiet option --- 0c/7d2d6c6d05bcebb4033afead4baf9ecb0b5d3e | 96 +++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 0c/7d2d6c6d05bcebb4033afead4baf9ecb0b5d3e diff --git a/0c/7d2d6c6d05bcebb4033afead4baf9ecb0b5d3e b/0c/7d2d6c6d05bcebb4033afead4baf9ecb0b5d3e new file mode 100644 index 000000000..118fe220e --- /dev/null +++ b/0c/7d2d6c6d05bcebb4033afead4baf9ecb0b5d3e @@ -0,0 +1,96 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 65499431FBD + for ; Sun, 26 Jan 2014 10:58:57 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.7 +X-Spam-Level: +X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 + tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id 3kvJxAvzRWqt for ; + Sun, 26 Jan 2014 10:58:51 -0800 (PST) +Received: from mail-ee0-f43.google.com (mail-ee0-f43.google.com + [74.125.83.43]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client + certificate requested) by olra.theworths.org (Postfix) with ESMTPS id + 4EB80431FBC for ; Sun, 26 Jan 2014 10:58:51 -0800 + (PST) +Received: by mail-ee0-f43.google.com with SMTP id c41so1864967eek.2 + for ; Sun, 26 Jan 2014 10:58:48 -0800 (PST) +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=1e100.net; s=20130820; + h=x-gm-message-state:from:to:cc:subject:date:message-id; + bh=R/2HIf1LFjk7nWn6cbKy6JSAE1gNqu1Z7fWzLsP66lc=; + b=Tm4S8UlJQPNQmBolBnbjm498H1PvW+UUBK/0O95w805SagU3He/YRv653QsWFX25/v + dkc8KCo3AFFj05Dah1DF9FR+NDbbJIJQd+izkWZoXSayiUIHtV3OzmZ5uOuBMeyzNFjD + vv9ihjs/p4IFT9VaLZfN5vFG31Fpgjojz2b87XJOTMO+7uWO38FtJIz/jvn31vXIWOKS + QOQywoV4t7XDAnmc5Zbl/+gkGy5tkjzhpMgHkivM8JqYUU4HaJPbpUsr8Jm2QuqGvIfQ + nO2kjA3m/otvSOJSjibFKLgy9z6RliolEsKKDgYDRKyEvWl1kJyBuXI1e8SLj4j8khJr + g01w== +X-Gm-Message-State: + ALoCoQmEeOCKx+Hskg07JLzlcZhOHOPogToIfONdbpByZ2/5MlZafm5qYVbkP5cNp46urA83cmSX +X-Received: by 10.14.98.129 with SMTP id v1mr21515308eef.5.1390762728723; + Sun, 26 Jan 2014 10:58:48 -0800 (PST) +Received: from localhost (dsl-hkibrasgw2-58c36f-91.dhcp.inet.fi. + [88.195.111.91]) + by mx.google.com with ESMTPSA id m1sm10745946een.7.2014.01.26.10.58.47 + for + (version=TLSv1.2 cipher=RC4-SHA bits=128/128); + Sun, 26 Jan 2014 10:58:48 -0800 (PST) +From: Jani Nikula +To: notmuch@notmuchmail.org +Subject: [PATCH] test: add basic tests for notmuch new --quiet option +Date: Sun, 26 Jan 2014 20:58:46 +0200 +Message-Id: <1390762726-14075-1-git-send-email-jani@nikula.org> +X-Mailer: git-send-email 1.8.5.2 +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Sun, 26 Jan 2014 18:58:57 -0000 + +This does not cover all the possible paths notmuch new could output +stuff, but it's better than nothing. +--- + test/T050-new.sh | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +diff --git a/test/T050-new.sh b/test/T050-new.sh +index f27423d..b7668ff 100755 +--- a/test/T050-new.sh ++++ b/test/T050-new.sh +@@ -248,4 +248,19 @@ ln -s i_do_not_exist "${MAIL_DIR}"/broken_link + output=$(NOTMUCH_NEW 2>&1) + test_expect_equal "$output" "No new mail." + ++test_begin_subtest "Quiet: No new mail." ++output=$(NOTMUCH_NEW --quiet) ++test_expect_equal "$output" "" ++ ++test_begin_subtest "Quiet: new, removed and renamed messages." ++# new ++generate_message ++# deleted ++notmuch search --format=text0 --output=files --limit=1 '*' | xargs -0 rm ++# moved ++mkdir "${MAIL_DIR}"/moved_messages ++notmuch search --format=text0 --output=files --offset=1 --limit=1 '*' | xargs -0 -I {} mv {} "${MAIL_DIR}"/moved_messages ++output=$(NOTMUCH_NEW --quiet) ++test_expect_equal "$output" "" ++ + test_done +-- +1.8.5.2 + -- 2.26.2