From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.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 0M2QIWNl6WEAWwEAgWs5BA (envelope-from ) for ; Thu, 20 Jan 2022 14:36:35 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id AEHNHmNl6WFmZgAA9RJhRA (envelope-from ) for ; Thu, 20 Jan 2022 14:36:35 +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 4C0012FF04 for ; Thu, 20 Jan 2022 14:36:35 +0100 (CET) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 830A05F714; Thu, 20 Jan 2022 13:36:17 +0000 (UTC) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by mail.notmuchmail.org (Postfix) with ESMTP id 992F55F714 for ; Thu, 20 Jan 2022 13:36:14 +0000 (UTC) Received: by fethera.tethera.net (Postfix, from userid 1001) id 08EB35FC75; Thu, 20 Jan 2022 08:36:13 -0500 (EST) Received: (nullmailer pid 31631 invoked by uid 1000); Thu, 20 Jan 2022 13:36:08 -0000 From: David Bremner To: notmuch@notmuchmail.org Subject: [PATCH v2 1/6] test/search: add known broken tests for 'date' prefix Date: Thu, 20 Jan 2022 09:36:00 -0400 Message-Id: <20220120133605.31401-2-david@tethera.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220120133605.31401-1-david@tethera.net> References: <20220120133605.31401-1-david@tethera.net> MIME-Version: 1.0 Message-ID-Hash: OLBBVPEKOWJGCM5JL3YFQEIDLBDQCUWO X-Message-ID-Hash: OLBBVPEKOWJGCM5JL3YFQEIDLBDQCUWO 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=1642685795; 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=Sy7ajkYTwsJ2OzmoeR0YQO0ONtDe85sk99GXH7ivSBK0D6zBesP1XmaGt51ccwFuB8i9kf BkawPwe/A8zVNO179+vz4VTuAgCb2fiL6vI3e1ho0di+hOgNZRnYgq6gAbDyiOqxzyHRRS nK0hAQW2zcpYA3QSsmDud4IRhOT3EAGRmJ4apUHkQupL1oh9pSh16NCqz1KPMPEIVQay2G qmPf/mHY3GmPbGZaughMz1VZO70OtVTUhHQ1+EOBpIXaB2vVECu3efvtZnpciqkJRKVPn7 3RbQK5xXwZwKXyn/l4gZxvCS9YfoTJb5ctcR0a3isyf9XlI9Wx30kANOMCKpew== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1642685795; a=rsa-sha256; cv=none; b=PQQzylU0lkUCBnpTDq7zZvqsYhGKcMqW8Tx6fyCAu4pEIaZ7nsoxa5ux67+4VHPS840Zd4 x8MentCLa6xwEZ+ieDj+Il0nhpMzsU4yslp8HW6jcNHvo8kUwnckagM1MhzhM+b/sGpu2A LfFbEPRlTd3l/poJ8CXU512fejd48sgJBomzQ3i+Ii2kotvGixgpC89YBbOfuwnCScBVE7 3ijxs6F5UA8XVhwC7daf0ZDrrq1M7c8gDReYldZdImAviadp+Z0EzV8fI2MXvTruZt/zEj tUS8vGd+cYQrq2UKgKjMg3ZJZAPh2Br01E9NM/Gida7FJMKlTBGGWOcjZh+e5A== 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: 4C0012FF04 X-Spam-Score: -1.35 X-Migadu-Scanner: scn1.migadu.com X-TUID: X56MbAVZ4G/b 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