From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.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 AP/wBUy302EaBgAAgWs5BA (envelope-from ) for ; Tue, 04 Jan 2022 03:56:12 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id OLUeOku302FHeAAAG6o9tA (envelope-from ) for ; Tue, 04 Jan 2022 03:56:11 +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 B51F219765 for ; Tue, 4 Jan 2022 03:56:11 +0100 (CET) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 015905F72E; Tue, 4 Jan 2022 02:55:47 +0000 (UTC) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by mail.notmuchmail.org (Postfix) with ESMTP id 9721D5F717 for ; Tue, 4 Jan 2022 02:55:43 +0000 (UTC) Received: by fethera.tethera.net (Postfix, from userid 1001) id D58E25FC51; Mon, 3 Jan 2022 21:55:42 -0500 (EST) Received: (nullmailer pid 1725897 invoked by uid 1000); Tue, 04 Jan 2022 02:55:35 -0000 From: David Bremner To: notmuch@notmuchmail.org Subject: [PATCH 1/6] test/search: add known broken tests for 'date' prefix Date: Mon, 3 Jan 2022 22:55:24 -0400 Message-Id: <20220104025529.1725839-2-david@tethera.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220104025529.1725839-1-david@tethera.net> References: <20220104025529.1725839-1-david@tethera.net> MIME-Version: 1.0 Message-ID-Hash: 7L4VBS5O5OTTO5Q5QZISYGJ3LTQ4DWBV X-Message-ID-Hash: 7L4VBS5O5OTTO5Q5QZISYGJ3LTQ4DWBV 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=1641264971; 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=8qgZ8FXQ5aKn+lANu12NQrPcL9l9huBC1Y0QTqmTkE4=; b=CrbbhB7PbAxDZaATJjJR8kvodq+A/MLwlxHzpvwbYFABoIFzGCi7hh2XaHTYShE59iT/dT uTrEUYO32FOkdOyHVv2bFoOzvxh6aRhiK9H3n1j0DlTP4QpsO4uwu75a1/iz8dQg222w48 vkLpKnmBciwLESFXKZCTDdv917wyQr2CcYhwmmbwc1CT7kSrrOrwmwKbIMYdEVwlfs+XeG 7rUpzt86yTDmSo8KbeciB3n9aZur6w3SyWfv865QUlqAAgQFsjlUL3HhwkanveUjv/GhYV +55ZWWnI6fTmZZhOS5CjXjiZSno+XWYbUUj+wTI9p72ef7z+cCmx5RgsLwYkog== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1641264971; a=rsa-sha256; cv=none; b=GAdSbr8QQ7idGdGxN8rWeOAXbRNA9kZSUYRVsh3rbirtnhWx7+Zz6O/zqId/1Nj4qxT6lm fD5JKMvtPEZkaIFEeh/PsqpbYs4dyBA2xFGgKif2Rg++7KRVm6n5/uWgHJEsdpavWBrHr+ u+ywqMzFsJWuf7wfbVt65K/fDJGTeD/aQAvZdPK5koOXeBPnBVGdEkzv3qhJLXj6ck/RxP tC5W1teGPzUfuchNnXsBQ7fHPmFeEI/mgPEhGzcoUb4Soes6KLwWMcVayw/FSYFCdK7GmI yTvMdILfsE9xJ+282IEI0+citG600g7hTrBqCAe82BTws8Yc9QwvTp/Ogu9u1g== 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.24 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: B51F219765 X-Spam-Score: -1.24 X-Migadu-Scanner: scn0.migadu.com X-TUID: nLWWgEmGSSI3 This is documented, but apparently not implemented. Add tests for planned supported syntax and error messages. --- test/T081-sexpr-search.sh | 72 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/test/T081-sexpr-search.sh b/test/T081-sexpr-search.sh index 2a8ad5f1..d8f8872d 100755 --- a/test/T081-sexpr-search.sh +++ b/test/T081-sexpr-search.sh @@ -768,6 +768,78 @@ notmuch search date:2009-11-18..2009-11-18 and tag:unread > EXPECTED notmuch search --query=sexp '(and (infix "date:2009-11-18..2009-11-18") (infix "tag:unread"))' > OUTPUT test_expect_equal_file EXPECTED OUTPUT +test_begin_subtest "date query, empty" +test_subtest_known_broken +notmuch search from:keithp | notmuch_search_sanitize > EXPECTED +notmuch search --query=sexp '(and (date) (from keithp))'| notmuch_search_sanitize > OUTPUT +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "date query, one argument" +test_subtest_known_broken +notmuch search date:2009-11-18 and from:keithp | notmuch_search_sanitize > EXPECTED +notmuch search --query=sexp '(and (date 2009-11-18) (from keithp))' | notmuch_search_sanitize > OUTPUT +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "date query, two arguments" +test_subtest_known_broken +notmuch search date:2009-11-17..2009-11-18 and from:keithp | notmuch_search_sanitize > EXPECTED +notmuch search --query=sexp '(and (date 2009-11-17 2009-11-18) (from keithp))' | notmuch_search_sanitize > OUTPUT +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "date query, illegal nesting 1" +test_subtest_known_broken +notmuch search --query=sexp '(to (date))' > OUTPUT 2>&1 +cat < EXPECTED +notmuch search: Syntax error in query +nested field: 'date' inside 'to' +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "date query, illegal nesting 2" +test_subtest_known_broken +notmuch search --query=sexp '(to (date 2021-11-18))' > OUTPUT 2>&1 +cat < EXPECTED +notmuch search: Syntax error in query +nested field: 'date' inside 'to' +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "date query, illegal nesting 3" +test_subtest_known_broken +notmuch search --query=sexp '(date (to))' > OUTPUT 2>&1 +cat < EXPECTED +notmuch search: Syntax error in query +expected atom as first argument of 'date' +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "date query, illegal nesting 4" +test_subtest_known_broken +notmuch search --query=sexp '(date today (to))' > OUTPUT 2>&1 +cat < EXPECTED +notmuch search: Syntax error in query +expected atom as second argument of 'date' +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "date query, too many arguments" +test_subtest_known_broken +notmuch search --query=sexp '(date yesterday and tommorow)' > OUTPUT 2>&1 +cat < EXPECTED +notmuch search: Syntax error in query +'date' expects maximum of two arguments +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "date query, bad date" +test_subtest_known_broken +notmuch search --query=sexp '(date "hawaiian-pizza-day")' > OUTPUT 2>&1 +cat < EXPECTED +notmuch search: Syntax error in query +Didn't understand date specification 'hawaiian-pizza-day' +EOF +test_expect_equal_file EXPECTED OUTPUT + test_begin_subtest "user header (unknown header)" notmuch search --query=sexp '(FooBar)' >& OUTPUT cat < EXPECTED -- 2.34.1