[PATCH v2 3/3] test: Update tests for 'authors_matched' and authors_non_matched'.
authorDavid Edmondson <dme@dme.org>
Fri, 24 Oct 2014 17:44:03 +0000 (18:44 +0100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 18:05:39 +0000 (10:05 -0800)
84/b4380f0d9bb0dd8f403e01823a0da186870095 [new file with mode: 0644]

diff --git a/84/b4380f0d9bb0dd8f403e01823a0da186870095 b/84/b4380f0d9bb0dd8f403e01823a0da186870095
new file mode 100644 (file)
index 0000000..b09cc8f
--- /dev/null
@@ -0,0 +1,160 @@
+Return-Path: <dme@dme.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 2198D431FD4\r
+       for <notmuch@notmuchmail.org>; Fri, 24 Oct 2014 10:44:21 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.699\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.699 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_LOW=-0.7, UNPARSEABLE_RELAY=0.001]\r
+       autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id y4606dVhcyvV for <notmuch@notmuchmail.org>;\r
+       Fri, 24 Oct 2014 10:44:14 -0700 (PDT)\r
+Received: from mail-wg0-f41.google.com (mail-wg0-f41.google.com\r
+ [74.125.82.41])       (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
+ certificate requested)        by olra.theworths.org (Postfix) with ESMTPS id\r
+ E50A4431FD7   for <notmuch@notmuchmail.org>; Fri, 24 Oct 2014 10:44:10 -0700\r
+ (PDT)\r
+Received: by mail-wg0-f41.google.com with SMTP id b13so1626537wgh.24\r
+       for <notmuch@notmuchmail.org>; Fri, 24 Oct 2014 10:44:09 -0700 (PDT)\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+       d=1e100.net; s=20130820;\r
+       h=x-gm-message-state:user-agent:from:to:subject:date:message-id\r
+       :in-reply-to:references:mime-version:content-type\r
+       :content-transfer-encoding;\r
+       bh=k2cYpPgF9E1NvNUqi8RMVPtHzU/IfjGBRvahAZ75YHc=;\r
+       b=bTvwWttWeFE/dUyOvS29jxV133qYVxjzvRxCrWp9wTeVRG+vRxIJrBLJTuBh5Fov4S\r
+       3WiRwoocr7++d4Yq+Nhp5pquSb1hySSKtC4+xo8z83Gptb/5mApZz2CNT+frIpm7/YtO\r
+       uSXl5DSkVTLfH+NncRsXwos2sEXuc/kEu95mecerMERZDotXySDeQ4AAny+C/TYpjTN/\r
+       VAUolFWuKQSk6JKQuUN+qUAiFRdbltdvyL8cMqeP56GlIu9PACwY36yYcBH4Kj5n082L\r
+       sVi0j4eRPGNmQrVbUYZg9wY175oHmZtlcW3aMaLlhcHvaQsTnaOVOiabpC8owPOd+ZXA\r
+       p3Xg==\r
+X-Gm-Message-State:\r
+ ALoCoQljBaaYM8BjGNNLt9IJQO5Onns0MuNV55lPj8HVTQnlIpTnehMtnsTk4Etc0ukk0WOL0X12\r
+X-Received: by 10.180.36.38 with SMTP id n6mr5402832wij.27.1414172649503;\r
+       Fri, 24 Oct 2014 10:44:09 -0700 (PDT)\r
+Received: from disaster-area.hh.sledj.net (disaster-area.hh.sledj.net.\r
+       [81.149.164.25])\r
+       by mx.google.com with ESMTPSA id dq7sm2726263wid.12.2014.10.24.10.44.08\r
+       for <notmuch@notmuchmail.org>\r
+       (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
+       Fri, 24 Oct 2014 10:44:08 -0700 (PDT)\r
+Received: from localhost (30000@localhost [local]);\r
+       by localhost (OpenSMTPD) with ESMTPA id 531357ab;\r
+       for <notmuch@notmuchmail.org>; Fri, 24 Oct 2014 17:44:03 +0000 (UTC)\r
+User-Agent: OpenSMTPD enqueuer (Demoostik)\r
+From: David Edmondson <dme@dme.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v2 3/3] test: Update tests for 'authors_matched' and\r
+       authors_non_matched'.\r
+Date: Fri, 24 Oct 2014 18:44:03 +0100\r
+Message-Id: <1414172643-28270-4-git-send-email-dme@dme.org>\r
+X-Mailer: git-send-email 2.1.1\r
+In-Reply-To: <1414172643-28270-1-git-send-email-dme@dme.org>\r
+References: <1414172643-28270-1-git-send-email-dme@dme.org>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=UTF-8\r
+Content-Transfer-Encoding: 8bit\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Fri, 24 Oct 2014 17:44:21 -0000\r
+\r
+---\r
+ test/T160-json.sh            | 9 +++++++++\r
+ test/T170-sexp.sh            | 4 ++--\r
+ test/T470-missing-headers.sh | 8 ++++++++\r
+ 3 files changed, 19 insertions(+), 2 deletions(-)\r
+\r
+diff --git a/test/T160-json.sh b/test/T160-json.sh\r
+index c1cf649..0a8df18 100755\r
+--- a/test/T160-json.sh\r
++++ b/test/T160-json.sh\r
+@@ -25,6 +25,10 @@ test_expect_equal_json "$output" "[{\"thread\": \"XXX\",\r
+  \"matched\": 1,\r
+  \"total\": 1,\r
+  \"authors\": \"Notmuch Test Suite\",\r
++ \"authors_matched\": [\r
++     \"Notmuch Test Suite\"\r
++ ],\r
++ \"authors_non_matched\": [],\r
+  \"subject\": \"json-search-subject\",\r
+  \"query\": [\"id:$gen_msg_id\", null],\r
+  \"tags\": [\"inbox\",\r
+@@ -59,6 +63,11 @@ test_expect_equal_json "$output" "[{\"thread\": \"XXX\",\r
+  \"matched\": 1,\r
+  \"total\": 1,\r
+  \"authors\": \"Notmuch Test Suite\",\r
++ \"authors\": \"Notmuch Test Suite\",\r
++ \"authors_matched\": [\r
++     \"Notmuch Test Suite\"\r
++ ],\r
++ \"authors_non_matched\": [],\r
+  \"subject\": \"json-search-utf8-body-sübjéct\",\r
+  \"query\": [\"id:$gen_msg_id\", null],\r
+  \"tags\": [\"inbox\",\r
+diff --git a/test/T170-sexp.sh b/test/T170-sexp.sh\r
+index 667e319..f2a08bf 100755\r
+--- a/test/T170-sexp.sh\r
++++ b/test/T170-sexp.sh\r
+@@ -19,7 +19,7 @@ test_expect_equal "$output" "((((:id \"${gen_msg_id}\" :match t :excluded nil :f\r
+ test_begin_subtest "Search message: sexp"\r
+ add_message "[subject]=\"sexp-search-subject\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=\"sexp-search-message\""\r
+ output=$(notmuch search --format=sexp "sexp-search-message" | notmuch_search_sanitize)\r
+-test_expect_equal "$output" "((:thread \"0000000000000002\" :timestamp 946728000 :date_relative \"2000-01-01\" :matched 1 :total 1 :authors \"Notmuch Test Suite\" :subject \"sexp-search-subject\" :query (\"id:$gen_msg_id\" nil) :tags (\"inbox\" \"unread\")))"\r
++test_expect_equal "$output" "((:thread \"0000000000000002\" :timestamp 946728000 :date_relative \"2000-01-01\" :matched 1 :total 1 :authors \"Notmuch Test Suite\" :authors_matched (\"Notmuch Test Suite\") :authors_non_matched () :subject \"sexp-search-subject\" :query (\"id:$gen_msg_id\" nil) :tags (\"inbox\" \"unread\")))"\r
\r
+ test_begin_subtest "Show message: sexp, utf-8"\r
+ add_message "[subject]=\"sexp-show-utf8-body-sübjéct\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=\"jsön-show-méssage\""\r
+@@ -44,7 +44,7 @@ test_expect_equal "$output" "((((:id \"$id\" :match t :excluded nil :filename \"\r
+ test_begin_subtest "Search message: sexp, utf-8"\r
+ add_message "[subject]=\"sexp-search-utf8-body-sübjéct\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=\"jsön-search-méssage\""\r
+ output=$(notmuch search --format=sexp "jsön-search-méssage" | notmuch_search_sanitize)\r
+-test_expect_equal "$output" "((:thread \"0000000000000005\" :timestamp 946728000 :date_relative \"2000-01-01\" :matched 1 :total 1 :authors \"Notmuch Test Suite\" :subject \"sexp-search-utf8-body-sübjéct\" :query (\"id:$gen_msg_id\" nil) :tags (\"inbox\" \"unread\")))"\r
++test_expect_equal "$output" "((:thread \"0000000000000005\" :timestamp 946728000 :date_relative \"2000-01-01\" :matched 1 :total 1 :authors \"Notmuch Test Suite\" :authors_matched (\"Notmuch Test Suite\") :authors_non_matched () :subject \"sexp-search-utf8-body-sübjéct\" :query (\"id:$gen_msg_id\" nil) :tags (\"inbox\" \"unread\")))"\r
\r
\r
+ test_done\r
+diff --git a/test/T470-missing-headers.sh b/test/T470-missing-headers.sh\r
+index cb38301..250a370 100755\r
+--- a/test/T470-missing-headers.sh\r
++++ b/test/T470-missing-headers.sh\r
+@@ -34,6 +34,10 @@ test_expect_equal_json "$output" '\r
+ [\r
+     {\r
+         "authors": "",\r
++        "authors_matched": [\r
++            ""\r
++        ],\r
++        "authors_non_matched": [],\r
+         "date_relative": "2001-01-05",\r
+         "matched": 1,\r
+         "subject": "",\r
+@@ -48,6 +52,10 @@ test_expect_equal_json "$output" '\r
+     },\r
+     {\r
+         "authors": "Notmuch Test Suite",\r
++        "authors_matched": [\r
++            "Notmuch Test Suite"\r
++        ],\r
++        "authors_non_matched": [],\r
+         "date_relative": "1970-01-01",\r
+         "matched": 1,\r
+         "subject": "",\r
+-- \r
+2.1.1\r
+\r