From c7fb7d30f5484bb82bac6fe8d7dd71a85e1eb16a Mon Sep 17 00:00:00 2001 From: Jesse Rosenthal Date: Thu, 30 Oct 2014 16:51:45 +2000 Subject: [PATCH] [v2 3/3] thread-naming test: Test empty subject names. --- 3e/998dc6c63689c660f58ec40add171e91a40805 | 100 ++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 3e/998dc6c63689c660f58ec40add171e91a40805 diff --git a/3e/998dc6c63689c660f58ec40add171e91a40805 b/3e/998dc6c63689c660f58ec40add171e91a40805 new file mode 100644 index 000000000..23499e12c --- /dev/null +++ b/3e/998dc6c63689c660f58ec40add171e91a40805 @@ -0,0 +1,100 @@ +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 F3D81431FCB + for ; Wed, 29 Oct 2014 13:52:19 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] + 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 HVpMIiVqsDkz for ; + Wed, 29 Oct 2014 13:52:12 -0700 (PDT) +Received: from smtpauth.johnshopkins.edu (smtpauth.johnshopkins.edu + [128.220.229.177]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id ABDCE431FC2 + for ; Wed, 29 Oct 2014 13:52:12 -0700 (PDT) +X-IronPort-AV: E=Sophos;i="5.07,279,1413259200"; d="scan'208";a="129235986" +Received: from guppy.hwcampus.jhu.edu (HELO localhost) ([10.161.32.234]) + by IPMTW4.johnshopkins.edu with ESMTP/TLS/AES128-SHA; + 29 Oct 2014 16:52:10 -0400 +From: Jesse Rosenthal +To: notmuch@notmuchmail.org +Subject: [v2 3/3] thread-naming test: Test empty subject names. +Date: Wed, 29 Oct 2014 16:51:45 -0400 +Message-Id: <1414615905-22554-4-git-send-email-jrosenthal@jhu.edu> +X-Mailer: git-send-email 2.1.2 +In-Reply-To: <1414615905-22554-1-git-send-email-jrosenthal@jhu.edu> +References: <1414615905-22554-1-git-send-email-jrosenthal@jhu.edu> +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, 29 Oct 2014 20:52:20 -0000 + +We test all empty subjects, and then empty subjects followed by +non-empty subjects (searching both oldest- and newest-first). +--- + test/T200-thread-naming.sh | 32 ++++++++++++++++++++++++++++++++ + 1 file changed, 32 insertions(+) + +diff --git a/test/T200-thread-naming.sh b/test/T200-thread-naming.sh +index 1a1a48f..dcfc1b3 100755 +--- a/test/T200-thread-naming.sh ++++ b/test/T200-thread-naming.sh +@@ -63,6 +63,38 @@ add_message '[subject]="Sv: thread-naming: Initial thread subject"' \ + output=$(notmuch search --sort=newest-first thread-naming and tag:inbox | notmuch_search_sanitize) + test_expect_equal "$output" "thread:XXX 2001-01-12 [6/8] Notmuch Test Suite; thread-naming: Initial thread subject (inbox unread)" + ++test_begin_subtest "Use empty subjects if necessary." ++add_message '[subject]="@FORCE_EMPTY"' \ ++ '[date]="Sat, 13 Jan 2001 15:43:45 -0000"' \ ++ '[from]="Empty Sender \"' ++empty_parent=${gen_msg_id} ++add_message '[subject]="@FORCE_EMPTY"' \ ++ '[date]="Sun, 14 Jan 2001 15:43:45 -0000"' \ ++ '[from]="Empty Sender \"' \ ++ "[in-reply-to]=\<$empty_parent\>" ++output=$(notmuch search --sort=newest-first from:empty_test@notmuchmail.org | notmuch_search_sanitize) ++test_expect_equal "$output" "thread:XXX 2001-01-14 [2/2] Empty Sender; (inbox unread)" ++ ++test_begin_subtest "Avoid empty subjects if possible (newest-first)." ++add_message '[subject]="Non-empty subject (1)"' \ ++ '[date]="Mon, 15 Jan 2001 15:43:45 -0000"' \ ++ '[from]="Empty Sender \"' \ ++ "[in-reply-to]=\<$empty_parent\>" ++add_message '[subject]="Non-empty subject (2)"' \ ++ '[date]="Mon, 16 Jan 2001 15:43:45 -0000"' \ ++ '[from]="Empty Sender \"' \ ++ "[in-reply-to]=\<$empty_parent\>" ++add_message '[subject]="@FORCE_EMPTY"' \ ++ '[date]="Tue, 17 Jan 2001 15:43:45 -0000"' \ ++ '[from]="Empty Sender \"' \ ++ "[in-reply-to]=\<$empty_parent\>" ++output=$(notmuch search --sort=newest-first from:Empty | notmuch_search_sanitize) ++test_expect_equal "$output" "thread:XXX 2001-01-17 [5/5] Empty Sender; Non-empty subject (2) (inbox unread)" ++ ++test_begin_subtest "Avoid empty subjects if possible (oldest-first)." ++output=$(notmuch search --sort=oldest-first from:Empty | notmuch_search_sanitize) ++test_expect_equal "$output" "thread:XXX 2001-01-13 [5/5] Empty Sender; Non-empty subject (1) (inbox unread)" ++ + test_begin_subtest 'Test order of messages in "notmuch show"' + output=$(notmuch show thread-naming | notmuch_show_sanitize) + test_expect_equal "$output" " +message{ id:msg-$(printf "%03d" $first)@notmuch-test-suite depth:0 match:1 excluded:0 filename:/XXX/mail/msg-$(printf "%03d" $first) +-- +2.1.2 + -- 2.26.2