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 08F264196F3 for ; Thu, 22 Apr 2010 21:42:31 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -1.9 X-Spam-Level: X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9] autolearn=ham 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 welsZUi-lLmc for ; Thu, 22 Apr 2010 21:42:30 -0700 (PDT) Received: from mail.hohndel.org (mail.hohndel.org [65.23.157.147]) by olra.theworths.org (Postfix) with ESMTP id EC8AF4196F2 for ; Thu, 22 Apr 2010 21:42:29 -0700 (PDT) Received: by mail.hohndel.org (Postfix, from userid 112) id 9B35C340FA; Fri, 23 Apr 2010 00:42:29 -0400 (EDT) Received: from x200.gr8dns.org (unknown [65.23.157.147]) by mail.hohndel.org (Postfix) with ESMTP id D3D88340F4; Fri, 23 Apr 2010 00:42:28 -0400 (EDT) Received: by x200.gr8dns.org (Postfix, from userid 500) id 7A875C0458; Thu, 22 Apr 2010 21:42:28 -0700 (PDT) From: Dirk Hohndel To: Subject: [PATCH 1/2] Add tests for author reordering Date: Thu, 22 Apr 2010 21:42:14 -0700 Message-Id: <1271997735-17560-2-git-send-email-hohndel@infradead.org> X-Mailer: git-send-email 1.6.6.1 In-Reply-To: <1271997735-17560-1-git-send-email-hohndel@infradead.org> References: <1271997735-17560-1-git-send-email-hohndel@infradead.org> 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: Fri, 23 Apr 2010 04:42:31 -0000 Test the different permutation of which authors match the search; This exposes a bug in the existing reordering code Signed-off-by: Dirk Hohndel --- test/notmuch-test | 27 +++++++++++++++++++++++++++ 1 files changed, 27 insertions(+), 0 deletions(-) diff --git a/test/notmuch-test b/test/notmuch-test index 3c1cd9f..2b76f04 100755 --- a/test/notmuch-test +++ b/test/notmuch-test @@ -858,6 +858,33 @@ printf " Searching returns all three messages in one thread..." output=$($NOTMUCH search foo | notmuch_search_sanitize) pass_if_equal "$output" "thread:XXX 2000-01-01 [3/3] Notmuch Test Suite; brokenthreadtest (inbox unread)" +printf "\nTesting author reordering;\n" +printf " Adding parent message...\t\t\t" +generate_message [body]=findme [id]=new-parent-id [subject]=author-reorder-threadtest '[from]="User "' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' +output=$(NOTMUCH_NEW) +pass_if_equal "$output" "Added 1 new message to the database." +printf " Adding initial child message...\t\t" +generate_message [body]=findme '[in-reply-to]=\' [subject]=author-reorder-threadtest '[from]="User1 "' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' +output=$(NOTMUCH_NEW) +pass_if_equal "$output" "Added 1 new message to the database." +printf " Adding second child message...\t\t\t" +generate_message [body]=findme '[in-reply-to]=\' [subject]=author-reorder-threadtest '[from]="User2 "' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' +output=$(NOTMUCH_NEW) +pass_if_equal "$output" "Added 1 new message to the database." +printf " Searching when all three messages match...\t" +output=$($NOTMUCH search findme | notmuch_search_sanitize) +pass_if_equal "$output" "thread:XXX 2000-01-01 [3/3] User, User1, User2; author-reorder-threadtest (inbox unread)" +printf " Searching when two messages match...\t\t" +output=$($NOTMUCH search User1 or User2 | notmuch_search_sanitize) +pass_if_equal "$output" "thread:XXX 2000-01-01 [2/3] User1, User2| User; author-reorder-threadtest (inbox unread)" +printf " Searching when only one message matches...\t" +output=$($NOTMUCH search User2 | notmuch_search_sanitize) +pass_if_equal "$output" "thread:XXX 2000-01-01 [1/3] User2| User, User1; author-reorder-threadtest (inbox unread)" +printf " Searching when only first message matches...\t" +output=$($NOTMUCH search User | notmuch_search_sanitize) +pass_if_equal "$output" "thread:XXX 2000-01-01 [1/3] User| User1, User2; author-reorder-threadtest (inbox unread)" + + echo "" echo "Notmuch test suite complete." -- 1.6.6.1