From: Carl Worth Date: Mon, 20 Sep 2010 21:36:31 +0000 (-0700) Subject: test: Print section names, and rename all test sections X-Git-Tag: 0.4~88 X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=commitdiff_plain;h=4813ee41d63e8bb6f699303be3123be12dfde3f5;ds=sidebyside test: Print section names, and rename all test sections Now that we can usefully pass section names via the NOTMUCH_SKIP_TESTS environment variable, it's useful to actually print those names out for the user. Then, since we're now printing these names, let's use nicer names, (not excessively long but also not using abbreviations like "msg"). --- diff --git a/test/author-order b/test/author-order new file mode 100755 index 00000000..d618b858 --- /dev/null +++ b/test/author-order @@ -0,0 +1,36 @@ +#!/bin/bash +test_description="author reordering;" +. ./test-lib.sh + +test_begin_subtest "Adding parent message" +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) +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"' +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"' +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_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_begin_subtest "Searching when only one message matches" +output=$($NOTMUCH search User2 | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2000-01-01 [1/3] User2| User, User1; author-reorder-threadtest (inbox unread)" + +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_done diff --git a/test/author-reordering b/test/author-reordering deleted file mode 100755 index d618b858..00000000 --- a/test/author-reordering +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash -test_description="author reordering;" -. ./test-lib.sh - -test_begin_subtest "Adding parent message" -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) -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"' -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"' -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_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_begin_subtest "Searching when only one message matches" -output=$($NOTMUCH search User2 | notmuch_search_sanitize) -test_expect_equal "$output" "thread:XXX 2000-01-01 [1/3] User2| User, User1; author-reorder-threadtest (inbox unread)" - -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_done diff --git a/test/encoding b/test/encoding new file mode 100755 index 00000000..73ca62ad --- /dev/null +++ b/test/encoding @@ -0,0 +1,24 @@ +#!/bin/bash +test_description="Testing encoding issues" +. ./test-lib.sh + +test_begin_subtest "Message with text of unknown charset" +add_message '[content-type]="text/plain; charset=unknown-8bit"' \ + "[body]=irrelevant" +output=$($NOTMUCH show id:${gen_msg_id} 2>&1 | notmuch_show_sanitize) +test_expect_equal "$output" " message{ id:msg-001@notmuch-test-suite depth:0 match:1 filename:/XXX/mail/msg-001 + header{ +Notmuch Test Suite (2001-01-05) (inbox unread) +Subject: Test message #1 +From: Notmuch Test Suite +To: Notmuch Test Suite +Date: Tue, 05 Jan 2001 15:43:57 -0000 + header} + body{ + part{ ID: 1, Content-type: text/plain +irrelevant + part} + body} + message}" + +test_done diff --git a/test/encoding-issues b/test/encoding-issues deleted file mode 100755 index 73ca62ad..00000000 --- a/test/encoding-issues +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -test_description="Testing encoding issues" -. ./test-lib.sh - -test_begin_subtest "Message with text of unknown charset" -add_message '[content-type]="text/plain; charset=unknown-8bit"' \ - "[body]=irrelevant" -output=$($NOTMUCH show id:${gen_msg_id} 2>&1 | notmuch_show_sanitize) -test_expect_equal "$output" " message{ id:msg-001@notmuch-test-suite depth:0 match:1 filename:/XXX/mail/msg-001 - header{ -Notmuch Test Suite (2001-01-05) (inbox unread) -Subject: Test message #1 -From: Notmuch Test Suite -To: Notmuch Test Suite -Date: Tue, 05 Jan 2001 15:43:57 -0000 - header} - body{ - part{ ID: 1, Content-type: text/plain -irrelevant - part} - body} - message}" - -test_done diff --git a/test/from-guessing b/test/from-guessing new file mode 100755 index 00000000..613917c9 --- /dev/null +++ b/test/from-guessing @@ -0,0 +1,205 @@ +#!/bin/bash +test_description="From line heuristics (with multiple configured addresses)" +. ./test-lib.sh + +test_begin_subtest "Magic from guessing (nothing to go on)" +add_message '[from]="Sender "' \ + [to]=mailinglist@notmuchmail.org \ + [subject]=notmuch-reply-test \ + '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ + '[body]="from guessing test"' + +output=$($NOTMUCH reply id:${gen_msg_id}) +test_expect_equal "$output" "From: Notmuch Test Suite +Subject: Re: notmuch-reply-test +To: Sender , mailinglist@notmuchmail.org +Bcc: test_suite@notmuchmail.org +In-Reply-To: <${gen_msg_id}> +References: <${gen_msg_id}> + +On Tue, 05 Jan 2010 15:43:56 -0000, Sender wrote: +> from guessing test" + +test_begin_subtest "Magic from guessing (Envelope-to:)" +add_message '[from]="Sender "' \ + [to]=mailinglist@notmuchmail.org \ + [subject]=notmuch-reply-test \ + '[header]="Envelope-To: test_suite_other@notmuchmail.org"' \ + '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ + '[body]="from guessing test"' + +output=$($NOTMUCH reply id:${gen_msg_id}) +test_expect_equal "$output" "From: Notmuch Test Suite +Subject: Re: notmuch-reply-test +To: Sender , mailinglist@notmuchmail.org +Bcc: test_suite@notmuchmail.org +In-Reply-To: <${gen_msg_id}> +References: <${gen_msg_id}> + +On Tue, 05 Jan 2010 15:43:56 -0000, Sender wrote: +> from guessing test" + +test_begin_subtest "Magic from guessing (X-Original-To:)" +add_message '[from]="Sender "' \ + [to]=mailinglist@notmuchmail.org \ + [subject]=notmuch-reply-test \ + '[header]="X-Original-To: test_suite_other@notmuchmail.org"' \ + '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ + '[body]="from guessing test"' + +output=$($NOTMUCH reply id:${gen_msg_id}) +test_expect_equal "$output" "From: Notmuch Test Suite +Subject: Re: notmuch-reply-test +To: Sender , mailinglist@notmuchmail.org +Bcc: test_suite@notmuchmail.org +In-Reply-To: <${gen_msg_id}> +References: <${gen_msg_id}> + +On Tue, 05 Jan 2010 15:43:56 -0000, Sender wrote: +> from guessing test" + +test_begin_subtest "Magic from guessing (Received: .. for ..)" +add_message '[from]="Sender "' \ + [to]=mailinglist@notmuchmail.org \ + [subject]=notmuch-reply-test \ + "[header]=\"Received: from mail.example.com (mail.example.com [1.1.1.1])\ + by mail.notmuchmail.org (some MTA) with ESMTP id 12345678\ + for ; Sat, 10 Apr 2010 07:54:51 -0400 (EDT)\"" \ + '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ + '[body]="from guessing test"' + +output=$($NOTMUCH reply id:${gen_msg_id}) +test_expect_equal "$output" "From: Notmuch Test Suite +Subject: Re: notmuch-reply-test +To: Sender , mailinglist@notmuchmail.org +Bcc: test_suite@notmuchmail.org +In-Reply-To: <${gen_msg_id}> +References: <${gen_msg_id}> + +On Tue, 05 Jan 2010 15:43:56 -0000, Sender wrote: +> from guessing test" + +test_begin_subtest "Magic from guessing (Received: domain)" +add_message '[from]="Sender "' \ + [to]=mailinglist@notmuchmail.org \ + [subject]=notmuch-reply-test \ + "[header]=\"Received: from mail.example.com (mail.example.com [1.1.1.1])\ + by mail.otherdomain.org (some MTA) with ESMTP id 12345678\ + Sat, 10 Apr 2010 07:54:51 -0400 (EDT)\"" \ + '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ + '[body]="from guessing test"' + +output=$($NOTMUCH reply id:${gen_msg_id}) +test_expect_equal "$output" "From: Notmuch Test Suite +Subject: Re: notmuch-reply-test +To: Sender , mailinglist@notmuchmail.org +Bcc: test_suite@notmuchmail.org +In-Reply-To: <${gen_msg_id}> +References: <${gen_msg_id}> + +On Tue, 05 Jan 2010 15:43:56 -0000, Sender wrote: +> from guessing test" + + +test_begin_subtest "Testing From line heuristics (with single configured address)" +sed -i -e "s/^other_email.*//" "${NOTMUCH_CONFIG}" + +test_begin_subtest "Magic from guessing (nothing to go on)" +add_message '[from]="Sender "' \ + [to]=mailinglist@notmuchmail.org \ + [subject]=notmuch-reply-test \ + '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ + '[body]="from guessing test"' + +output=$($NOTMUCH reply id:${gen_msg_id}) +test_expect_equal "$output" "From: Notmuch Test Suite +Subject: Re: notmuch-reply-test +To: Sender , mailinglist@notmuchmail.org +Bcc: test_suite@notmuchmail.org +In-Reply-To: <${gen_msg_id}> +References: <${gen_msg_id}> + +On Tue, 05 Jan 2010 15:43:56 -0000, Sender wrote: +> from guessing test" + +test_begin_subtest "Magic from guessing (Envelope-to:)" +add_message '[from]="Sender "' \ + [to]=mailinglist@notmuchmail.org \ + [subject]=notmuch-reply-test \ + '[header]="Envelope-To: test_suite_other@notmuchmail.org"' \ + '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ + '[body]="from guessing test"' + +output=$($NOTMUCH reply id:${gen_msg_id}) +test_expect_equal "$output" "From: Notmuch Test Suite +Subject: Re: notmuch-reply-test +To: Sender , mailinglist@notmuchmail.org +Bcc: test_suite@notmuchmail.org +In-Reply-To: <${gen_msg_id}> +References: <${gen_msg_id}> + +On Tue, 05 Jan 2010 15:43:56 -0000, Sender wrote: +> from guessing test" + +test_begin_subtest "Magic from guessing (X-Original-To:)" +add_message '[from]="Sender "' \ + [to]=mailinglist@notmuchmail.org \ + [subject]=notmuch-reply-test \ + '[header]="X-Original-To: test_suite_other@notmuchmail.org"' \ + '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ + '[body]="from guessing test"' + +output=$($NOTMUCH reply id:${gen_msg_id}) +test_expect_equal "$output" "From: Notmuch Test Suite +Subject: Re: notmuch-reply-test +To: Sender , mailinglist@notmuchmail.org +Bcc: test_suite@notmuchmail.org +In-Reply-To: <${gen_msg_id}> +References: <${gen_msg_id}> + +On Tue, 05 Jan 2010 15:43:56 -0000, Sender wrote: +> from guessing test" + +test_begin_subtest "Magic from guessing (Received: .. for ..)" +add_message '[from]="Sender "' \ + [to]=mailinglist@notmuchmail.org \ + [subject]=notmuch-reply-test \ + "[header]=\"Received: from mail.example.com (mail.example.com [1.1.1.1])\ + by mail.notmuchmail.org (some MTA) with ESMTP id 12345678\ + for ; Sat, 10 Apr 2010 07:54:51 -0400 (EDT)\"" \ + '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ + '[body]="from guessing test"' + +output=$($NOTMUCH reply id:${gen_msg_id}) +test_expect_equal "$output" "From: Notmuch Test Suite +Subject: Re: notmuch-reply-test +To: Sender , mailinglist@notmuchmail.org +Bcc: test_suite@notmuchmail.org +In-Reply-To: <${gen_msg_id}> +References: <${gen_msg_id}> + +On Tue, 05 Jan 2010 15:43:56 -0000, Sender wrote: +> from guessing test" + +test_begin_subtest "Magic from guessing (Received: domain)" +add_message '[from]="Sender "' \ + [to]=mailinglist@notmuchmail.org \ + [subject]=notmuch-reply-test \ + "[header]=\"Received: from mail.example.com (mail.example.com [1.1.1.1])\ + by mail.otherdomain.org (some MTA) with ESMTP id 12345678\ + Sat, 10 Apr 2010 07:54:51 -0400 (EDT)\"" \ + '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ + '[body]="from guessing test"' + +output=$($NOTMUCH reply id:${gen_msg_id}) +test_expect_equal "$output" "From: Notmuch Test Suite +Subject: Re: notmuch-reply-test +To: Sender , mailinglist@notmuchmail.org +Bcc: test_suite@notmuchmail.org +In-Reply-To: <${gen_msg_id}> +References: <${gen_msg_id}> + +On Tue, 05 Jan 2010 15:43:56 -0000, Sender wrote: +> from guessing test" + +test_done diff --git a/test/from-line-heuristics b/test/from-line-heuristics deleted file mode 100755 index 613917c9..00000000 --- a/test/from-line-heuristics +++ /dev/null @@ -1,205 +0,0 @@ -#!/bin/bash -test_description="From line heuristics (with multiple configured addresses)" -. ./test-lib.sh - -test_begin_subtest "Magic from guessing (nothing to go on)" -add_message '[from]="Sender "' \ - [to]=mailinglist@notmuchmail.org \ - [subject]=notmuch-reply-test \ - '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ - '[body]="from guessing test"' - -output=$($NOTMUCH reply id:${gen_msg_id}) -test_expect_equal "$output" "From: Notmuch Test Suite -Subject: Re: notmuch-reply-test -To: Sender , mailinglist@notmuchmail.org -Bcc: test_suite@notmuchmail.org -In-Reply-To: <${gen_msg_id}> -References: <${gen_msg_id}> - -On Tue, 05 Jan 2010 15:43:56 -0000, Sender wrote: -> from guessing test" - -test_begin_subtest "Magic from guessing (Envelope-to:)" -add_message '[from]="Sender "' \ - [to]=mailinglist@notmuchmail.org \ - [subject]=notmuch-reply-test \ - '[header]="Envelope-To: test_suite_other@notmuchmail.org"' \ - '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ - '[body]="from guessing test"' - -output=$($NOTMUCH reply id:${gen_msg_id}) -test_expect_equal "$output" "From: Notmuch Test Suite -Subject: Re: notmuch-reply-test -To: Sender , mailinglist@notmuchmail.org -Bcc: test_suite@notmuchmail.org -In-Reply-To: <${gen_msg_id}> -References: <${gen_msg_id}> - -On Tue, 05 Jan 2010 15:43:56 -0000, Sender wrote: -> from guessing test" - -test_begin_subtest "Magic from guessing (X-Original-To:)" -add_message '[from]="Sender "' \ - [to]=mailinglist@notmuchmail.org \ - [subject]=notmuch-reply-test \ - '[header]="X-Original-To: test_suite_other@notmuchmail.org"' \ - '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ - '[body]="from guessing test"' - -output=$($NOTMUCH reply id:${gen_msg_id}) -test_expect_equal "$output" "From: Notmuch Test Suite -Subject: Re: notmuch-reply-test -To: Sender , mailinglist@notmuchmail.org -Bcc: test_suite@notmuchmail.org -In-Reply-To: <${gen_msg_id}> -References: <${gen_msg_id}> - -On Tue, 05 Jan 2010 15:43:56 -0000, Sender wrote: -> from guessing test" - -test_begin_subtest "Magic from guessing (Received: .. for ..)" -add_message '[from]="Sender "' \ - [to]=mailinglist@notmuchmail.org \ - [subject]=notmuch-reply-test \ - "[header]=\"Received: from mail.example.com (mail.example.com [1.1.1.1])\ - by mail.notmuchmail.org (some MTA) with ESMTP id 12345678\ - for ; Sat, 10 Apr 2010 07:54:51 -0400 (EDT)\"" \ - '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ - '[body]="from guessing test"' - -output=$($NOTMUCH reply id:${gen_msg_id}) -test_expect_equal "$output" "From: Notmuch Test Suite -Subject: Re: notmuch-reply-test -To: Sender , mailinglist@notmuchmail.org -Bcc: test_suite@notmuchmail.org -In-Reply-To: <${gen_msg_id}> -References: <${gen_msg_id}> - -On Tue, 05 Jan 2010 15:43:56 -0000, Sender wrote: -> from guessing test" - -test_begin_subtest "Magic from guessing (Received: domain)" -add_message '[from]="Sender "' \ - [to]=mailinglist@notmuchmail.org \ - [subject]=notmuch-reply-test \ - "[header]=\"Received: from mail.example.com (mail.example.com [1.1.1.1])\ - by mail.otherdomain.org (some MTA) with ESMTP id 12345678\ - Sat, 10 Apr 2010 07:54:51 -0400 (EDT)\"" \ - '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ - '[body]="from guessing test"' - -output=$($NOTMUCH reply id:${gen_msg_id}) -test_expect_equal "$output" "From: Notmuch Test Suite -Subject: Re: notmuch-reply-test -To: Sender , mailinglist@notmuchmail.org -Bcc: test_suite@notmuchmail.org -In-Reply-To: <${gen_msg_id}> -References: <${gen_msg_id}> - -On Tue, 05 Jan 2010 15:43:56 -0000, Sender wrote: -> from guessing test" - - -test_begin_subtest "Testing From line heuristics (with single configured address)" -sed -i -e "s/^other_email.*//" "${NOTMUCH_CONFIG}" - -test_begin_subtest "Magic from guessing (nothing to go on)" -add_message '[from]="Sender "' \ - [to]=mailinglist@notmuchmail.org \ - [subject]=notmuch-reply-test \ - '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ - '[body]="from guessing test"' - -output=$($NOTMUCH reply id:${gen_msg_id}) -test_expect_equal "$output" "From: Notmuch Test Suite -Subject: Re: notmuch-reply-test -To: Sender , mailinglist@notmuchmail.org -Bcc: test_suite@notmuchmail.org -In-Reply-To: <${gen_msg_id}> -References: <${gen_msg_id}> - -On Tue, 05 Jan 2010 15:43:56 -0000, Sender wrote: -> from guessing test" - -test_begin_subtest "Magic from guessing (Envelope-to:)" -add_message '[from]="Sender "' \ - [to]=mailinglist@notmuchmail.org \ - [subject]=notmuch-reply-test \ - '[header]="Envelope-To: test_suite_other@notmuchmail.org"' \ - '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ - '[body]="from guessing test"' - -output=$($NOTMUCH reply id:${gen_msg_id}) -test_expect_equal "$output" "From: Notmuch Test Suite -Subject: Re: notmuch-reply-test -To: Sender , mailinglist@notmuchmail.org -Bcc: test_suite@notmuchmail.org -In-Reply-To: <${gen_msg_id}> -References: <${gen_msg_id}> - -On Tue, 05 Jan 2010 15:43:56 -0000, Sender wrote: -> from guessing test" - -test_begin_subtest "Magic from guessing (X-Original-To:)" -add_message '[from]="Sender "' \ - [to]=mailinglist@notmuchmail.org \ - [subject]=notmuch-reply-test \ - '[header]="X-Original-To: test_suite_other@notmuchmail.org"' \ - '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ - '[body]="from guessing test"' - -output=$($NOTMUCH reply id:${gen_msg_id}) -test_expect_equal "$output" "From: Notmuch Test Suite -Subject: Re: notmuch-reply-test -To: Sender , mailinglist@notmuchmail.org -Bcc: test_suite@notmuchmail.org -In-Reply-To: <${gen_msg_id}> -References: <${gen_msg_id}> - -On Tue, 05 Jan 2010 15:43:56 -0000, Sender wrote: -> from guessing test" - -test_begin_subtest "Magic from guessing (Received: .. for ..)" -add_message '[from]="Sender "' \ - [to]=mailinglist@notmuchmail.org \ - [subject]=notmuch-reply-test \ - "[header]=\"Received: from mail.example.com (mail.example.com [1.1.1.1])\ - by mail.notmuchmail.org (some MTA) with ESMTP id 12345678\ - for ; Sat, 10 Apr 2010 07:54:51 -0400 (EDT)\"" \ - '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ - '[body]="from guessing test"' - -output=$($NOTMUCH reply id:${gen_msg_id}) -test_expect_equal "$output" "From: Notmuch Test Suite -Subject: Re: notmuch-reply-test -To: Sender , mailinglist@notmuchmail.org -Bcc: test_suite@notmuchmail.org -In-Reply-To: <${gen_msg_id}> -References: <${gen_msg_id}> - -On Tue, 05 Jan 2010 15:43:56 -0000, Sender wrote: -> from guessing test" - -test_begin_subtest "Magic from guessing (Received: domain)" -add_message '[from]="Sender "' \ - [to]=mailinglist@notmuchmail.org \ - [subject]=notmuch-reply-test \ - "[header]=\"Received: from mail.example.com (mail.example.com [1.1.1.1])\ - by mail.otherdomain.org (some MTA) with ESMTP id 12345678\ - Sat, 10 Apr 2010 07:54:51 -0400 (EDT)\"" \ - '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ - '[body]="from guessing test"' - -output=$($NOTMUCH reply id:${gen_msg_id}) -test_expect_equal "$output" "From: Notmuch Test Suite -Subject: Re: notmuch-reply-test -To: Sender , mailinglist@notmuchmail.org -Bcc: test_suite@notmuchmail.org -In-Reply-To: <${gen_msg_id}> -References: <${gen_msg_id}> - -On Tue, 05 Jan 2010 15:43:56 -0000, Sender wrote: -> from guessing test" - -test_done diff --git a/test/long-id b/test/long-id new file mode 100755 index 00000000..1f55d716 --- /dev/null +++ b/test/long-id @@ -0,0 +1,27 @@ +#!/bin/bash +test_description="Testing messages with ridiculously-long message IDs" +. ./test-lib.sh + +test_begin_subtest "Referencing long ID before adding" +generate_message '[subject]="Reference of ridiculously-long message ID"' \ + "[references]=\" +output=$(NOTMUCH_NEW) +test_expect_equal "$output" "Added 1 new message to the database." + +test_begin_subtest "Adding message with long ID" +generate_message '[subject]="A ridiculously-long message ID"' \ + "[id]=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-" +output=$(NOTMUCH_NEW) +test_expect_equal "$output" "Added 1 new message to the database." + +test_begin_subtest "Referencing long ID after adding" +generate_message '[subject]="Reply to ridiculously-long message ID"' \ + "[in-reply-to]=\" +output=$(NOTMUCH_NEW) +test_expect_equal "$output" "Added 1 new message to the database." + +test_begin_subtest "Ensure all messages were threaded together" +output=$($NOTMUCH search 'subject:"a ridiculously-long message ID"' | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-05 [1/3] Notmuch Test Suite; A ridiculously-long message ID (inbox unread)" + +test_done diff --git a/test/long-msgid b/test/long-msgid deleted file mode 100755 index 1f55d716..00000000 --- a/test/long-msgid +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash -test_description="Testing messages with ridiculously-long message IDs" -. ./test-lib.sh - -test_begin_subtest "Referencing long ID before adding" -generate_message '[subject]="Reference of ridiculously-long message ID"' \ - "[references]=\" -output=$(NOTMUCH_NEW) -test_expect_equal "$output" "Added 1 new message to the database." - -test_begin_subtest "Adding message with long ID" -generate_message '[subject]="A ridiculously-long message ID"' \ - "[id]=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-" -output=$(NOTMUCH_NEW) -test_expect_equal "$output" "Added 1 new message to the database." - -test_begin_subtest "Referencing long ID after adding" -generate_message '[subject]="Reply to ridiculously-long message ID"' \ - "[in-reply-to]=\" -output=$(NOTMUCH_NEW) -test_expect_equal "$output" "Added 1 new message to the database." - -test_begin_subtest "Ensure all messages were threaded together" -output=$($NOTMUCH search 'subject:"a ridiculously-long message ID"' | notmuch_search_sanitize) -test_expect_equal "$output" "thread:XXX 2001-01-05 [1/3] Notmuch Test Suite; A ridiculously-long message ID (inbox unread)" - -test_done diff --git a/test/notmuch-test b/test/notmuch-test index 294c3fd7..fc1a66bf 100755 --- a/test/notmuch-test +++ b/test/notmuch-test @@ -8,7 +8,7 @@ cd $(dirname "$0") -TESTS="basic new search json thread-naming reply dump-restore uuencode threading-out-of-order author-reordering from-line-heuristics long-msgid encoding-issues" +TESTS="basic new search json thread-naming reply dump-restore uuencode thread-order author-order from-guessing long-id encoding" # Clean up any results from a previous run rm -r test-results >/dev/null 2>/dev/null diff --git a/test/test-lib.sh b/test/test-lib.sh index b21b4358..7688fe0e 100644 --- a/test/test-lib.sh +++ b/test/test-lib.sh @@ -154,7 +154,7 @@ then exit 0 fi -echo "Testing ${test_description}" +echo $(basename "$0"): "Testing ${test_description}" exec 5>&1 if test "$verbose" = "t" diff --git a/test/thread-order b/test/thread-order new file mode 100755 index 00000000..47f25c86 --- /dev/null +++ b/test/thread-order @@ -0,0 +1,32 @@ +#!/bin/bash +test_description="threading when messages received out of order" +. ./test-lib.sh + +test_begin_subtest "Adding initial child message" +generate_message [body]=foo "[in-reply-to]=\" [subject]=brokenthreadtest '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' +output=$(NOTMUCH_NEW) +test_expect_equal "$output" "Added 1 new message to the database." + +test_begin_subtest "Searching returns the message" +output=$($NOTMUCH search foo | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; brokenthreadtest (inbox unread)" + +test_begin_subtest "Adding second child message" +generate_message [body]=foo "[in-reply-to]=\" [subject]=brokenthreadtest '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' +output=$(NOTMUCH_NEW) +test_expect_equal "$output" "Added 1 new message to the database." + +test_begin_subtest "Searching returns both messages in one thread" +output=$($NOTMUCH search foo | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2000-01-01 [2/2] Notmuch Test Suite; brokenthreadtest (inbox unread)" + +test_begin_subtest "Adding parent message" +generate_message [body]=foo [id]=parent-id [subject]=brokenthreadtest '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' +output=$(NOTMUCH_NEW) +test_expect_equal "$output" "Added 1 new message to the database." + +test_begin_subtest "Searching returns all three messages in one thread" +output=$($NOTMUCH search foo | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2000-01-01 [3/3] Notmuch Test Suite; brokenthreadtest (inbox unread)" + +test_done diff --git a/test/threading-out-of-order b/test/threading-out-of-order deleted file mode 100755 index 47f25c86..00000000 --- a/test/threading-out-of-order +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash -test_description="threading when messages received out of order" -. ./test-lib.sh - -test_begin_subtest "Adding initial child message" -generate_message [body]=foo "[in-reply-to]=\" [subject]=brokenthreadtest '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' -output=$(NOTMUCH_NEW) -test_expect_equal "$output" "Added 1 new message to the database." - -test_begin_subtest "Searching returns the message" -output=$($NOTMUCH search foo | notmuch_search_sanitize) -test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; brokenthreadtest (inbox unread)" - -test_begin_subtest "Adding second child message" -generate_message [body]=foo "[in-reply-to]=\" [subject]=brokenthreadtest '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' -output=$(NOTMUCH_NEW) -test_expect_equal "$output" "Added 1 new message to the database." - -test_begin_subtest "Searching returns both messages in one thread" -output=$($NOTMUCH search foo | notmuch_search_sanitize) -test_expect_equal "$output" "thread:XXX 2000-01-01 [2/2] Notmuch Test Suite; brokenthreadtest (inbox unread)" - -test_begin_subtest "Adding parent message" -generate_message [body]=foo [id]=parent-id [subject]=brokenthreadtest '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' -output=$(NOTMUCH_NEW) -test_expect_equal "$output" "Added 1 new message to the database." - -test_begin_subtest "Searching returns all three messages in one thread" -output=$($NOTMUCH search foo | notmuch_search_sanitize) -test_expect_equal "$output" "thread:XXX 2000-01-01 [3/3] Notmuch Test Suite; brokenthreadtest (inbox unread)" - -test_done