From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id WKnJIC5E62EuZQEAgWs5BA (envelope-from ) for ; Sat, 22 Jan 2022 00:39:26 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id 2Mh4HS5E62HK5AAAauVa8A (envelope-from ) for ; Sat, 22 Jan 2022 00:39:26 +0100 Received: from mail.notmuchmail.org (yantan.tethera.net [IPv6:2a01:4f9:c011:7a79::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 0E232A867 for ; Sat, 22 Jan 2022 00:39:25 +0100 (CET) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 0B9ED5F724; Fri, 21 Jan 2022 23:39:08 +0000 (UTC) Received: from fethera.tethera.net (fethera.tethera.net [IPv6:2607:5300:60:c5::1]) by mail.notmuchmail.org (Postfix) with ESMTP id 445965F712 for ; Fri, 21 Jan 2022 23:39:04 +0000 (UTC) Received: by fethera.tethera.net (Postfix, from userid 1001) id E9C975FC03; Fri, 21 Jan 2022 18:39:02 -0500 (EST) Received: (nullmailer pid 1049230 invoked by uid 1000); Fri, 21 Jan 2022 23:38:58 -0000 From: David Bremner To: David Bremner , David Edmondson , notmuch@notmuchmail.org Subject: [PATCH 5/6] test: add multiple path, folder sexp query tests Date: Fri, 21 Jan 2022 19:38:52 -0400 Message-Id: <20220121233853.1049166-6-david@tethera.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220121233853.1049166-1-david@tethera.net> References: <871stgid7j.fsf@tethera.net> <20220121233853.1049166-1-david@tethera.net> MIME-Version: 1.0 Message-ID-Hash: 5TKVPDJDB5C54WLZOS5IXSEWMDAFAM6B X-Message-ID-Hash: 5TKVPDJDB5C54WLZOS5IXSEWMDAFAM6B X-MailFrom: bremner@tethera.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.3 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN X-Migadu-Country: DE ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1642808365; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-owner:list-unsubscribe:list-subscribe:list-post; bh=x6WzKZ9TLcBkFJTXlpVgYgG/e/SQ9/uhb3tFum1TlMk=; b=txczvu+ILnPxOILO1Zk+p0T3eNCDgQ+5Xs7uysWxKvfAUf1t02lxPy3gwkEuP6AUtwoEFP s4n0dd0FilK/sHQtOwrEo8rCFM7Ztm+1nD83iFj92dRWB5FbRM5vXKHjrMrZRcca/mmVPS QrkGbPIS50Vs/XYJ1YUHhrW/Jn2ojx5eNzQFiEPgGIRyM2npsczGX8eLbGQQUozy5RYto7 sxGJSdI+oybYpf8wLeGkZDWn2tKoK3vMTZq7LZYLdnNKVvIzqZINNmDMIxYuxUlE87AkSG pcpn5Ey9NMr+lVPYbkTdrN7GeibuNGmB0+/wp623yYLkYAf+z7q6tGyOKK+YDw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1642808365; a=rsa-sha256; cv=none; b=lFPeIf9ERz660BheP93qfk65X7/lCjNLPpdKZqJISkfXFwvCYjVhaLVonqPttUKurM4zzs gXhUIT7dTzLfOS3ZSADNaLNLBmXiSb4Jc7OSUuTFziV8y6T88vVgvy6najNXqaykhtz9+u fZvlr6lM6qgZSQ3RaDsxPmD/WiS2UjNYOqHxSXHqvMAmZvT9L4XVZR7yrq5fn5X8UNbuyU dWsTUmnXcv6qs2pTTIGysxBnhfcDAHqshTyfzTgGk4Mr6rUFzB+gf5iWvSodWaKdUIovln p9+DBMHGqLKvHUfdPL7CDL9YPa4botM6N1wlqNtBywRBdflUoQZetQ/CQUY8mA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -2.32 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: 0E232A867 X-Spam-Score: -2.32 X-Migadu-Scanner: scn0.migadu.com X-TUID: 49rfes81V6au This is mainly to make sure we get trailing / removal correct. Also add regression test for path: in the infix parser matching the existing one for folder:. --- test/T081-sexpr-search.sh | 26 ++++++++++++++++++++++++++ test/T100-search-by-folder.sh | 6 ++++++ 2 files changed, 32 insertions(+) diff --git a/test/T081-sexpr-search.sh b/test/T081-sexpr-search.sh index a355f8b6..ebf2c59f 100755 --- a/test/T081-sexpr-search.sh +++ b/test/T081-sexpr-search.sh @@ -196,6 +196,19 @@ output=$(notmuch search --output=files --query=sexp '(folder bad/news/)' | notmu test_expect_equal "$output" "MAIL_DIR/bad/news/msg-XXX MAIL_DIR/duplicate/bad/news/msg-XXX" +test_begin_subtest "Search by 'folder' (multiple)" +output=$(notmuch search --query=sexp '(folder bad bad/news things/bad)' | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; To the bone (inbox unread) +thread:XXX 2001-01-05 [1/1(2)] Notmuch Test Suite; Bears (inbox unread) +thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Bites, stings, sad feelings (inbox unread)" + +test_begin_subtest "Search by 'folder' (multiple, trailing /)" +test_subtest_known_broken +output=$(notmuch search --query=sexp '(folder bad bad/news/ things/bad)' | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; To the bone (inbox unread) +thread:XXX 2001-01-05 [1/1(2)] Notmuch Test Suite; Bears (inbox unread) +thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Bites, stings, sad feelings (inbox unread)" + test_begin_subtest "Search by 'path' with --output=files" output=$(notmuch search --output=files --query=sexp '(path bad/news)' | notmuch_search_files_sanitize) test_expect_equal "$output" "MAIL_DIR/bad/news/msg-XXX @@ -207,6 +220,19 @@ output=$(notmuch search --output=files --query=sexp '(path bad/news/)' | notmuch test_expect_equal "$output" "MAIL_DIR/bad/news/msg-XXX MAIL_DIR/duplicate/bad/news/msg-XXX" +test_begin_subtest "Search by 'path' specification (multiple)" +output=$(notmuch search --query=sexp '(path bad bad/news things/bad)' | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; To the bone (inbox unread) +thread:XXX 2001-01-05 [1/1(2)] Notmuch Test Suite; Bears (inbox unread) +thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Bites, stings, sad feelings (inbox unread)" + +test_begin_subtest "Search by 'path' specification (multiple, trailing /)" +test_subtest_known_broken +output=$(notmuch search --query=sexp '(path bad bad/news/ things/bad)' | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; To the bone (inbox unread) +thread:XXX 2001-01-05 [1/1(2)] Notmuch Test Suite; Bears (inbox unread) +thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Bites, stings, sad feelings (inbox unread)" + test_begin_subtest "Search by 'id'" add_message '[subject]="search by id"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' output=$(notmuch search --query=sexp "(id ${gen_msg_id})" | notmuch_search_sanitize) diff --git a/test/T100-search-by-folder.sh b/test/T100-search-by-folder.sh index 0123d0b2..b4f6294e 100755 --- a/test/T100-search-by-folder.sh +++ b/test/T100-search-by-folder.sh @@ -18,6 +18,12 @@ test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; T thread:XXX 2001-01-05 [1/1(2)] Notmuch Test Suite; Bears (inbox unread) thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Bites, stings, sad feelings (inbox unread)" +test_begin_subtest "search by path: specification (multiple)" +output=$(notmuch search path:bad path:bad/news path:things/bad | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; To the bone (inbox unread) +thread:XXX 2001-01-05 [1/1(2)] Notmuch Test Suite; Bears (inbox unread) +thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Bites, stings, sad feelings (inbox unread)" + test_begin_subtest "Top level folder" output=$(notmuch search folder:'""' | notmuch_search_sanitize) test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Top level (inbox unread)" -- 2.34.1