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