From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 330D840DEFB for ; Wed, 17 Nov 2010 11:33:13 -0800 (PST) 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 Le2cASQ1ndfR for ; Wed, 17 Nov 2010 11:33:02 -0800 (PST) X-Greylist: delayed 300 seconds by postgrey-1.32 at olra; Wed, 17 Nov 2010 11:33:02 PST Received: from dmz-mailsec-scanner-5.mit.edu (DMZ-MAILSEC-SCANNER-5.MIT.EDU [18.7.68.34]) by olra.theworths.org (Postfix) with ESMTP id B4E8B40DEF0 for ; Wed, 17 Nov 2010 11:33:02 -0800 (PST) X-AuditID: 12074422-b7c3eae000000a70-e8-4ce42cc1799e Received: from mailhub-auth-3.mit.edu ( [18.9.21.43]) by dmz-mailsec-scanner-5.mit.edu (Symantec Brightmail Gateway) with SMTP id FC.E7.02672.1CC24EC4; Wed, 17 Nov 2010 14:28:01 -0500 (EST) Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id oAHJS0ah006234 for ; Wed, 17 Nov 2010 14:28:01 -0500 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91]) (authenticated bits=0) (User authenticated as amdragon@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id oAHJRxNx007532 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 17 Nov 2010 14:28:00 -0500 (EST) Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.72) (envelope-from ) id 1PInfj-0001ED-Bh for notmuch@notmuchmail.org; Wed, 17 Nov 2010 14:27:59 -0500 Date: Wed, 17 Nov 2010 14:27:59 -0500 From: Austin Clements To: notmuch@notmuchmail.org Subject: [PATCH 2/4] Make author order tests more strict. Message-ID: <20101117192759.GT2439@mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) X-Brightmail-Tracker: AAAAAA== 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, 17 Nov 2010 19:33:13 -0000 Use varying dates in the test messages to test the order authors are listed in. Add tests with repeated author names and unusual date ordering. Most of these are broken at the moment, but will be fixed shortly. --- test/author-order | 30 ++++++++++++++++++++++++++---- 1 files changed, 26 insertions(+), 4 deletions(-) diff --git a/test/author-order b/test/author-order index 9f0b931..2ddc91c 100755 --- a/test/author-order +++ b/test/author-order @@ -8,22 +8,22 @@ output=$(NOTMUCH_NEW) test_expect_equal "$output" "Added 1 new message to the database." test_begin_subtest "Adding initial child message" -generate_message [body]=findme "[in-reply-to]=\" [subject]=author-reorder-threadtest '[from]="User1 "' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' +generate_message [body]=findme "[in-reply-to]=\" [subject]=author-reorder-threadtest '[from]="User1 "' '[date]="Sat, 01 Jan 2000 12:01:00 -0000"' output=$(NOTMUCH_NEW) test_expect_equal "$output" "Added 1 new message to the database." test_begin_subtest "Adding second child message" -generate_message [body]=findme "[in-reply-to]=\" [subject]=author-reorder-threadtest '[from]="User2 "' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' +generate_message [body]=findme "[in-reply-to]=\" [subject]=author-reorder-threadtest '[from]="User2 "' '[date]="Sat, 01 Jan 2000 12:02:00 -0000"' output=$(NOTMUCH_NEW) test_expect_equal "$output" "Added 1 new message to the database." test_begin_subtest "Searching when all three messages match" output=$(notmuch search findme | notmuch_search_sanitize) -test_expect_equal "$output" "thread:XXX 2000-01-01 [3/3] User, User1, User2; author-reorder-threadtest (inbox unread)" +test_expect_equal_failure "$output" "thread:XXX 2000-01-01 [3/3] User, User1, User2; author-reorder-threadtest (inbox unread)" test_begin_subtest "Searching when two messages match" output=$(notmuch search User1 or User2 | notmuch_search_sanitize) -test_expect_equal "$output" "thread:XXX 2000-01-01 [2/3] User1, User2| User; author-reorder-threadtest (inbox unread)" +test_expect_equal_failure "$output" "thread:XXX 2000-01-01 [2/3] User1, User2| User; author-reorder-threadtest (inbox unread)" test_begin_subtest "Searching when only one message matches" output=$(notmuch search User2 | notmuch_search_sanitize) @@ -33,4 +33,26 @@ test_begin_subtest "Searching when only first message matches" output=$(notmuch search User | notmuch_search_sanitize) test_expect_equal "$output" "thread:XXX 2000-01-01 [1/3] User| User1, User2; author-reorder-threadtest (inbox unread)" +test_begin_subtest "Adding duplicate author" +generate_message [body]=findme "[in-reply-to]=\" [subject]=author-reorder-threadtest '[from]="User1 "' '[date]="Sat, 01 Jan 2000 12:03:00 -0000"' +output=$(NOTMUCH_NEW) +test_expect_equal "$output" "Added 1 new message to the database." + +test_begin_subtest "Searching when all four messages match" +output=$(notmuch search findme | notmuch_search_sanitize) +test_expect_equal_failure "$output" "thread:XXX 2000-01-01 [4/4] User, User1, User2; author-reorder-threadtest (inbox unread)" + +test_begin_subtest "Adding non-monotonic child message" +generate_message [body]=findme "[in-reply-to]=\" [subject]=author-reorder-threadtest '[from]="User0 "' '[date]="Sat, 01 Jan 2000 11:00:00 -0000"' +output=$(NOTMUCH_NEW) +test_expect_equal "$output" "Added 1 new message to the database." + +test_begin_subtest "Searching non-monotonic messages (oldest-first)" +output=$(notmuch search --sort=oldest-first findme | notmuch_search_sanitize) +test_expect_equal_failure "$output" "thread:XXX 2000-01-01 [5/5] User0, User, User1, User2; author-reorder-threadtest (inbox unread)" + +test_begin_subtest "Searching non-monotonic messages (newest-first)" +output=$(notmuch search --sort=newest-first findme | notmuch_search_sanitize) +test_expect_equal_failure "$output" "thread:XXX 2000-01-01 [5/5] User0, User, User1, User2; author-reorder-threadtest (inbox unread)" + test_done -- 1.7.2.3