From f21e70634d504568255e3341273f8ad3f4077053 Mon Sep 17 00:00:00 2001 From: Peter Wang Date: Wed, 20 Jun 2012 23:29:02 +1000 Subject: [PATCH] [PATCH 3/8] test: add tests for search --exclude=all --- a5/3b4afe00ef5409e81be8e018a6b96ba2840d3f | 110 ++++++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 a5/3b4afe00ef5409e81be8e018a6b96ba2840d3f diff --git a/a5/3b4afe00ef5409e81be8e018a6b96ba2840d3f b/a5/3b4afe00ef5409e81be8e018a6b96ba2840d3f new file mode 100644 index 000000000..2e86233f0 --- /dev/null +++ b/a5/3b4afe00ef5409e81be8e018a6b96ba2840d3f @@ -0,0 +1,110 @@ +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 63228431FD4 + for ; Wed, 20 Jun 2012 06:29:53 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.799 +X-Spam-Level: +X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 + tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, + FREEMAIL_FROM=0.001, 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 pjEcBZ0aX5B6 for ; + Wed, 20 Jun 2012 06:29:52 -0700 (PDT) +Received: from mail-pz0-f53.google.com (mail-pz0-f53.google.com + [209.85.210.53]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 23528431E62 + for ; Wed, 20 Jun 2012 06:29:44 -0700 (PDT) +Received: by mail-pz0-f53.google.com with SMTP id g9so12291942dad.26 + for ; Wed, 20 Jun 2012 06:29:44 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; + h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; + bh=ugCbcNrhd0NRMkn2/dDZ8tB/l8DIoaGbpCMPBj8XB/Y=; + b=IHmy5IjufdPuzsWIHcbLlmUKGRX/b+gwDXSfKPSsCOhAx8JlxMQ/Gw2Zeh9AetCxh4 + yEdIC9K9xVZySofDBqja04q24K4r/cA1Q6xY9gqXm5aU61hEp6tTVFukmu421BNbykgC + EgWrrCavH6+hBaRxqjyCOThl5U220slIchKU4ulxfk+sJ7KXwr32gJlcVRGXjTajoLoH + T34FHA4FwrvkWvpr9LoO6SaTnMjNKapNATPMudyjsi2Mz4AKplhzNubhN0q5NfIxhFbY + Spe4NAGA+jCFUR9TATATXAGbd3AXD2ZgiQ9d+kUYWvhrz/Nz5fbojWljyoWp4TIWm6Hg + iweg== +Received: by 10.68.224.225 with SMTP id rf1mr59819220pbc.55.1340198983902; + Wed, 20 Jun 2012 06:29:43 -0700 (PDT) +Received: from localhost (215.42.233.220.static.exetel.com.au. + [220.233.42.215]) + by mx.google.com with ESMTPS id ua6sm31943293pbc.20.2012.06.20.06.29.40 + (version=TLSv1/SSLv3 cipher=OTHER); + Wed, 20 Jun 2012 06:29:42 -0700 (PDT) +From: Peter Wang +To: notmuch@notmuchmail.org +Subject: [PATCH 3/8] test: add tests for search --exclude=all +Date: Wed, 20 Jun 2012 23:29:02 +1000 +Message-Id: <1340198947-29370-4-git-send-email-novalazy@gmail.com> +X-Mailer: git-send-email 1.7.4.4 +In-Reply-To: <1340198947-29370-1-git-send-email-novalazy@gmail.com> +References: <1340198947-29370-1-git-send-email-novalazy@gmail.com> +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: Wed, 20 Jun 2012 13:29:53 -0000 + +Test the new search --exclude=all option. +--- + test/excludes | 22 ++++++++++++++++++++++ + 1 files changed, 22 insertions(+), 0 deletions(-) + +diff --git a/test/excludes b/test/excludes +index 24d653e..f1ae9ea 100755 +--- a/test/excludes ++++ b/test/excludes +@@ -166,6 +166,16 @@ ${matching_message_ids[3]} + ${matching_message_ids[4]} + ${matching_message_ids[5]}" + ++test_begin_subtest "Search, exclude=all (thread summary)" ++output=$(notmuch search --exclude=all tag:test | notmuch_search_sanitize) ++test_expect_equal "$output" "thread:XXX 2001-01-05 [1/5] Notmuch Test Suite; Some messages excluded: single non-excluded match: reply 4 (inbox test unread) ++thread:XXX 2001-01-05 [1/6] Notmuch Test Suite; No messages excluded: single match: reply 3 (inbox test unread)" ++ ++test_begin_subtest "Search, exclude=all (messages)" ++output=$(notmuch search --exclude=all --output=messages tag:test | notmuch_search_sanitize) ++test_expect_equal "$output" "${matching_message_ids[4]} ++${matching_message_ids[5]}" ++ + test_begin_subtest "Search, default exclusion: tag in query (thread summary)" + output=$(notmuch search tag:test and tag:deleted | notmuch_search_sanitize) + test_expect_equal "$output" "thread:XXX 2001-01-05 [1/6] Notmuch Test Suite; All messages excluded: single match: reply 2 (deleted inbox test unread) +@@ -218,6 +228,18 @@ ${matching_message_ids[1]} + ${matching_message_ids[2]} + ${matching_message_ids[3]}" + ++test_begin_subtest "Search, exclude=all: tag in query (thread summary)" ++output=$(notmuch search --exclude=all tag:test and tag:deleted | notmuch_search_sanitize) ++test_expect_equal "$output" "thread:XXX 2001-01-05 [1/6] Notmuch Test Suite; All messages excluded: single match: reply 2 (deleted inbox test unread) ++thread:XXX 2001-01-05 [2/6] Notmuch Test Suite; All messages excluded: double match: reply 2 (deleted inbox test unread) ++thread:XXX 2001-01-05 [1/6] Notmuch Test Suite; Some messages excluded: single excluded match: reply 3 (deleted inbox test unread)" ++ ++test_begin_subtest "Search, exclude=all: tag in query (messages)" ++output=$(notmuch search --exclude=all --output=messages tag:test and tag:deleted | notmuch_search_sanitize) ++test_expect_equal "$output" "${matching_message_ids[0]} ++${matching_message_ids[1]} ++${matching_message_ids[2]} ++${matching_message_ids[3]}" + + ######################################################### + # Notmuch count tests +-- +1.7.4.4 + -- 2.26.2