From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id sBTsJjVE62GETQEAgWs5BA (envelope-from ) for ; Sat, 22 Jan 2022 00:39:33 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id GChuJDVE62FSOwAA9RJhRA (envelope-from ) for ; Sat, 22 Jan 2022 00:39:33 +0100 Received: from mail.notmuchmail.org (yantan.tethera.net [135.181.149.255]) (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 6ACB812DF0 for ; Sat, 22 Jan 2022 00:39:33 +0100 (CET) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id ACB885F72C; Fri, 21 Jan 2022 23:39:09 +0000 (UTC) Received: from fethera.tethera.net (fethera.tethera.net [IPv6:2607:5300:60:c5::1]) by mail.notmuchmail.org (Postfix) with ESMTP id D8DB75F70C for ; Fri, 21 Jan 2022 23:39:05 +0000 (UTC) Received: by fethera.tethera.net (Postfix, from userid 1001) id 3B2F85FC01; Fri, 21 Jan 2022 18:39:04 -0500 (EST) Received: (nullmailer pid 1049224 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 3/6] test/sexp: tests for path, folder, including trailing '/' (sexp) Date: Fri, 21 Jan 2022 19:38:50 -0400 Message-Id: <20220121233853.1049166-4-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: HESVRELW2XDHJAA5KYBGFMIWIQ5NZ4NU X-Message-ID-Hash: HESVRELW2XDHJAA5KYBGFMIWIQ5NZ4NU 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=1642808373; 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=jcgVpEN7E7txOYfBRXLK0To6oIU+LcanX7pjBIsOPcI=; b=HMd7pcwRQD62KGI2Effj7yZGoE9DC27Rsj5UjAWdQfn1wR6Rjfc7JSPh+6iBGuaQ5hRGmx zhasGA13CO8tu7XBz7Oe3ROQDQnp9mMgYf1bWd37U8K0SWFKNXh3ycd821OsAeVjoC6eTC 0ZRmtd//7gfe5WguAWM2fDeK/gFjn5wtZV93dja2HIbXkUZ/DPEqCAgTP3sgPuD2VuPEZZ fnRUg3ytXKpEJVntM6U3kVAgLD368nzYrFoqBvafRxDoqGvts76cgwuOS1T8NaVowlyK3p UmIOBazpZ8SSkbxRf/OGkaQ/eDdi0wkq80kUHsqAZA1rkZOjzE1kXV3xIb7NjA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1642808373; a=rsa-sha256; cv=none; b=o4UlbRp9M0qQ8EOpS2oBiWKw4ciyEgIvCSgxhMUaAexFBYLcEDp6g81i+4i0GfoK+Zmh+r CbzzCceGspGqVBysKGnQhMNf0KHN5v4tY7u95zN8kaTkUQtnRD3UZS9DANnD6HoLYVDrvc 7hYJ/Cz+Fsd0l8/QYWJyBNNyGZfN6kPaatlRuMp0VmU4Mm81a3l4XzZqblQQaD8GivRcA0 l4VCymO9mib62btC+bhuYaw9//jj8UWsFZDxzHlHOiaq8FCGrJ8zKhFxpOE/pZzWUxjisD cpeZJXW57mR3UE4WANa126xNHtD4Jh0es9uJd71rAACbRt3GufHKd453SW0dYw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -1.35 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: 6ACB812DF0 X-Spam-Score: -1.35 X-Migadu-Scanner: scn1.migadu.com X-TUID: rse7Tfa3pPh0 This duplicates the bug reported in [1], as well as adding some simple regression tests for 'path' and 'folder' searches which were previously missing for sexp syntax. [1]: id:cunoasuolcv.fsf@gargravarr.hh.sledj.net --- test/T081-sexpr-search.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/test/T081-sexpr-search.sh b/test/T081-sexpr-search.sh index 0e5af635..a355f8b6 100755 --- a/test/T081-sexpr-search.sh +++ b/test/T081-sexpr-search.sh @@ -185,6 +185,28 @@ notmuch search folder:'""' > EXPECTED notmuch search --query=sexp '(folder "")' > OUTPUT test_expect_equal_file EXPECTED OUTPUT +test_begin_subtest "Search by 'folder' with --output=files" +output=$(notmuch search --output=files --query=sexp '(folder bad/news)' | notmuch_search_files_sanitize) +test_expect_equal "$output" "MAIL_DIR/bad/news/msg-XXX +MAIL_DIR/duplicate/bad/news/msg-XXX" + +test_begin_subtest "Search by 'folder' with --output=files (trailing /)" +test_subtest_known_broken +output=$(notmuch search --output=files --query=sexp '(folder bad/news/)' | notmuch_search_files_sanitize) +test_expect_equal "$output" "MAIL_DIR/bad/news/msg-XXX +MAIL_DIR/duplicate/bad/news/msg-XXX" + +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 +MAIL_DIR/duplicate/bad/news/msg-XXX" + +test_begin_subtest "Search by 'path' with --output=files (trailing /)" +test_subtest_known_broken +output=$(notmuch search --output=files --query=sexp '(path bad/news/)' | notmuch_search_files_sanitize) +test_expect_equal "$output" "MAIL_DIR/bad/news/msg-XXX +MAIL_DIR/duplicate/bad/news/msg-XXX" + 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) -- 2.34.1