From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id QEwLMSNE62HzZgEAgWs5BA (envelope-from ) for ; Sat, 22 Jan 2022 00:39:15 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id APC+LSNE62FUkAAAauVa8A (envelope-from ) for ; Sat, 22 Jan 2022 00:39:15 +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 6B5A51BEF0 for ; Sat, 22 Jan 2022 00:39:15 +0100 (CET) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 317995F715; Fri, 21 Jan 2022 23:39:05 +0000 (UTC) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by mail.notmuchmail.org (Postfix) with ESMTP id 74E575F705 for ; Fri, 21 Jan 2022 23:39:01 +0000 (UTC) Received: by fethera.tethera.net (Postfix, from userid 1001) id AF4785FC03; Fri, 21 Jan 2022 18:39:00 -0500 (EST) Received: (nullmailer pid 1049221 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 2/6] test: known broken tests for trailing / in path search (infix) Date: Fri, 21 Jan 2022 19:38:49 -0400 Message-Id: <20220121233853.1049166-3-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: DBGNTDGKCW5EQGJ2RDRTB5ND3ZCEMJUC X-Message-ID-Hash: DBGNTDGKCW5EQGJ2RDRTB5ND3ZCEMJUC 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=1642808355; 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=QS40b/I1GR4jgzw4OkoOwmjDrWezGKLX51h2AZmxEgc=; b=ccQkvx+zfMwrv4qcAe98g85UfL31yZta3SSjtPDNlAE6W7lodNLZnXItW22ryZYPpOjN5K fS0iodI208/SMsDtN/vzw/u+juOqJ1xKqVFrWR5gbe3092wlYj7K2o07oxW/OjRUYEvEEF oHZchYWQ6sC7XIWifeCpHadt5/2HBjK/zVbUEZ2+FYNBMQTJGwD6ofdrmoqu42kgimmdfW caxf7nSf649xlHycWIGpdthyd3Pe+fDmv1Oin3WOdgNWK9tXN9KWLvv9fwpdbvfK1ruTIM 7rs0mYO/0tcsVI4gsp6k2GML/deh9FXXn8lm52aoYwqYcw9fh1BURg/VZAP8FQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1642808355; a=rsa-sha256; cv=none; b=f+4y0gyoIJr+dS2vZvqqiK7dju/puKVln/7wYQd+TYZ5mUTWK395DNw3aVImFIMnSU51C5 AJqwZSeNklWBKa+YM0+RC3b+Pmsi+W3W/WyyMCWmzxfeiYX+kb0v+mlpbbdvLa9/sUCqw/ e8utSXqQpgw21zGDtcVs/SUEd+hlffnTT3sMAt93dwpn7/uj25g5Q5F5BIESTLOKpgHGev 6cOonOFtEbGuq+ZbQ+pz93egRAv6MAAQTXFaiajPsBmiiZZRkFWq/pJo2LZF0R8W7blUe4 JYac0KQ+j3X/P+NRPPr3QMA4Gf3s1s7/E+kIz5dgb+uaRqccoRRyMh5mNbebdA== 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: -1.82 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: 6B5A51BEF0 X-Spam-Score: -1.82 X-Migadu-Scanner: scn0.migadu.com X-TUID: agdT1O4WQ0/2 In [1], David Edmondson observed that the trailing / added by many completion mechanisms causes path searches to silently fail. This test reproduces that bug for both `path:' and `folder:' searches. [1]: id:cunoasuolcv.fsf@gargravarr.hh.sledj.net --- test/T100-search-by-folder.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/T100-search-by-folder.sh b/test/T100-search-by-folder.sh index fc9ad5f8..fbc68266 100755 --- a/test/T100-search-by-folder.sh +++ b/test/T100-search-by-folder.sh @@ -31,6 +31,12 @@ output=$(notmuch search --output=files folder:bad/news | notmuch_search_files_sa test_expect_equal "$output" "MAIL_DIR/bad/news/msg-XXX MAIL_DIR/duplicate/bad/news/msg-XXX" +test_begin_subtest "Folder search with --output=files (trailing /)" +test_subtest_known_broken +output=$(notmuch search --output=files 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 "After removing duplicate instance of matching path" rm -r "${MAIL_DIR}/bad/news" notmuch new @@ -120,6 +126,14 @@ test_expect_equal "$output" "MAIL_DIR/bar/17:2, MAIL_DIR/bar/18:2, MAIL_DIR/cur/51:2," +test_begin_subtest "path: search (trailing /)" +test_subtest_known_broken +output=$(notmuch search --output=files path:"bar/" | notmuch_search_files_sanitize | sort) +# cur/51:2, is a duplicate of bar/18:2, +test_expect_equal "$output" "MAIL_DIR/bar/17:2, +MAIL_DIR/bar/18:2, +MAIL_DIR/cur/51:2," + test_begin_subtest "top level path: search" output=$(notmuch search --output=files path:'""' | notmuch_search_files_sanitize | sort) test_expect_equal "$output" "MAIL_DIR/01:2, -- 2.34.1