From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id aGAWOvsZs2ScygAASxT56A (envelope-from ) for ; Sun, 16 Jul 2023 00:13:16 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id mDkwOvsZs2RNwAAAauVa8A (envelope-from ) for ; Sun, 16 Jul 2023 00:13:15 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 4D8744D030 for ; Sun, 16 Jul 2023 00:13:15 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=outlook.com header.s=selector1 header.b=fCnCXi5H; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=outlook.com ARC-Seal: i=2; s=key1; d=yhetil.org; t=1689459195; a=rsa-sha256; cv=pass; b=Gq6pxCBI4s4vFDW06/cZxgFrYdftw4xx+bwb18dNreAr4nHJyBpkc0+jInWvxc9xM1dv9C j6OYQeET1vr3gnOBC77X+cqQM8f1wQZwNmnw2zu2r33ZPftnq1kYc5agVmHl2VcI5Rc5KE sOIa3o9SlqCcGNlcYlrwz/p3NeBQbTxjnViqpFk3ihBXFqPW2WfNsGvpGcvnTxdgkbwyjm C/q+s+CVEoCUsoQ6LAh/QdrJXPfvapzL6PNbOLWvfIoq+ogE+W7XZuq/Blethp8sS8ROCO NKkFa2c9CgezmryV1HZosAXHPvLRsFcdGIGs8SVb8h8U8luym0tbb/ZvWdabpQ== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=pass header.d=outlook.com header.s=selector1 header.b=fCnCXi5H; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=outlook.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1689459195; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=niok/IeYNG+yZdIW0HnX7HTWPkOl/JhM30qND/zfqDQ=; b=HAZWqtLlvKuSoMwDgSDLhn6/GkXu4rCaRIcbBuTQUe93+D8J3ceUrxlv2BRWdx4NJ/e9i1 o2Kdh2WmI5EhNP2H6gs3fTVlXCrJOsjey45kaj2mi2Jj1UofMNO4TEs5gFNBhdcYhTTAFk ex9F3DDugcgOCMZm0XZlREvnbOO8bYgP0pV4ZWgcAkkc4NzY2IHCIhL/PQ/hPJl3tTZFhf NvS2E/rJOTdbCY14b6DKemp+wBaOsa8n4Tn9DsoeqbRf163W8tE1VcOZwDvDcb3xM4jNAs PQKkfRhvtPUiuuprOSvgF+jqEiWOUgYmDV7HrwCwObWsP/RU8JGTilN3DecKeQ== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qKnUq-0001Wc-3R; Sat, 15 Jul 2023 18:12:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qKnUo-0001W9-GT for emacs-orgmode@gnu.org; Sat, 15 Jul 2023 18:12:10 -0400 Received: from mail-dm3nam02acsn20804.outbound.protection.outlook.com ([2a01:111:f400:7e83::804] helo=NAM02-DM3-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qKnUl-0000yi-Ff for emacs-orgmode@gnu.org; Sat, 15 Jul 2023 18:12:10 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PeG0mzSRCQkXmxgJY3qdqgOwaIl5mkgLi2/GjJWtv7DPwKI6VGj85QKGbWn8txQlZGc/sFGsiNlUGIOeghDUpgk0qbjo3LZ2LAyzCB1wg9J71OQoC7gWgoZWMYpkQDa33vTr1aWV0iqzc5OdYNQwD2hpD8h3327qiVbHZEMpzHx2tc5JgjUfboPWOZHy6vkHMh69m76u5S4n9xHHxuoPCSzXhanRyqebEYiIdiOpvvw7Dyd+nni9I6u7vNOucugkmSQQTqiwhUIMXhhgQlYw02KnbLcFV6j5KNTDgDxGSEEUu+65JJ38RjlTBBLz4K2DrV9llpNQ0+rvc/1U1Xubjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=niok/IeYNG+yZdIW0HnX7HTWPkOl/JhM30qND/zfqDQ=; b=O5XqtOO9WAb551/IfVBuO1MasMdTtont59H1CSvrrCNgPaKK+SGniefmXk12u3cJbPDHHF3QqVhkF19znBQw9+TKlXfCjdj4rJ6F146AAV4IdAvsKRmJJassM3Gl1pO/Hu2+MwzuYyThb6ynPo7ne3Oi4nSsffqdd8m9p4vnDO9QOskHtDNylr7Ztl26P1CHXu1EZOSNnUOino48S6uZBA0XCoAUbAFnJQstG9+hkeFXqooDpm1DBRYRj3k2YWBcF2lI6G8EWZ7q1gXQHmS/UeWV0i20MPCjxEBc3CZT8+eBuERM4ZvZ/nctqUgFQ/kioh0Q3axnohg2G6MGqWWJ7Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=niok/IeYNG+yZdIW0HnX7HTWPkOl/JhM30qND/zfqDQ=; b=fCnCXi5HH9ftKqWkaJEk0ryuYZvOWGqxbcnA1XJ9+cplX/2PETYF7iAM1gJUJY7+dLddDvqgz6uKIQ4NsLlPoc6iJnSLdX02VZskHzjS9RPbXHPowDRjZGr5JMxnBtI7lbT+s5oEF1+BhQmXRZNzroIIEtK8WO08qGK4Izc6Py0V3eGrKlm2PUWtY5BqUhznd/aCPcX46v69I5hO/V2rC5AQk4GXcx1ACczROnlxgtKIKPS1Zm+wAqpRY1xlZNMKoNvgY5yh0ibAzwOI07pdno0t/mfaQoDp4aVIbRNeinwI+R6ZqE37zTN3eFEdCOrx0pDigighgY62vjtgYghmIw== Received: from DM5PR03MB3163.namprd03.prod.outlook.com (2603:10b6:4:40::24) by DM6PR03MB5130.namprd03.prod.outlook.com (2603:10b6:5:1e3::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Sat, 15 Jul 2023 22:07:03 +0000 Received: from DM5PR03MB3163.namprd03.prod.outlook.com ([fe80::6d7:a135:f84c:a7b8]) by DM5PR03MB3163.namprd03.prod.outlook.com ([fe80::6d7:a135:f84c:a7b8%6]) with mapi id 15.20.6588.028; Sat, 15 Jul 2023 22:07:02 +0000 From: Morgan Smith To: emacs-orgmode@gnu.org Subject: [PATCH] Testing: Add tests for 'org-agenda-skip-if' Date: Sat, 15 Jul 2023 18:06:37 -0400 Message-ID: X-Mailer: git-send-email 2.41.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-TMN: [HKQzMw8C7/xz8fFx+8EA2wD9bm1/GDm1] X-ClientProxiedBy: YQBPR0101CA0303.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c01:6d::14) To DM5PR03MB3163.namprd03.prod.outlook.com (2603:10b6:4:40::24) X-Microsoft-Original-Message-ID: <20230715220636.14075-2-Morgan.J.Smith@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM5PR03MB3163:EE_|DM6PR03MB5130:EE_ X-MS-Office365-Filtering-Correlation-Id: 4efa4417-7c81-4df8-4e0e-08db857fd0f1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zUASzJOsZWqwwDpRojj+j6BGm/33HZAGfV52bY/TqJ+KKAe104vealOyVDB3vGVUbEire4l9ObSvws7sK9/tiBlSoJDH5UjySXPjWyt1Su3J9AL/Y+Aao2SKqpsUrQ+gh50imjM0fUVdC8X9IA7nQUwYUdeMTaUpIYlCAmwWqt0Hq9VpSMZEy6MFlbwzrGhtB+7kk2Fv2Y4wL+rFAo0hT/LGKY8EIprNmPXmXtZtXVcGuMMA1cKNAocW44n05TBMtpSCyfXvvUSHmOYlTqP+eRV/o9VUNN/DwWjnagyz9rUYKf9sOz9pryD68KFT1ubbSA7aSIvrJHkxMN9NqRAYz9g9en/7qteflTYMpcRrnZ5tQtCqJs8DsdF03DJngmsTXR5DloLK5dywLRrBRVus8e4ruwx36VtWpt3y/wdvcyym8AwivhiMv8+/MbliTi8ZDj4ztZIZfyomnfU+bYcxbEqmg+/unU3BD9/DWg/hShdig/kkgqmaJUCJMVRGqjj2Othg2WZJSvWlGCeWNqjpeHLtTen1TI7F7j2wBDhO8YQ= X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange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sG3ndQB1JM3jk7iet1XQRMWK4eysILSQdP3HzGxk2iZ6VNB4A?= =?us-ascii?Q?5Q7O8iVYtTNATt7B0kUZvQg++71+aj0bOLCXdATVt3oixiDxRKwUaEIueiwv?= =?us-ascii?Q?v2nk2cJjvxk8+ipQNI2G+1FhkE6GROxWZFpWmOTmV79OzTod6KP2iYUEPaMQ?= =?us-ascii?Q?lvlLt1zP8UepfdJ5WOe+JNhrXx2jTK453vEM9lQ7oo7EX7+US9trt7XYsnb+?= =?us-ascii?Q?2B+LT4XR0o6YJP2IkaUeMd6gjUajkl60ccLOk0d68sIz33OF80rH/8ZA8WKZ?= =?us-ascii?Q?UsFm5hT0jk43TJuIZ+ijCax3Jjv3IEPpWIIZe4Ccd1+I9d7gvyODy25d2z7t?= =?us-ascii?Q?NuQ9p5EOtPj70eGaTR/N3caCgUSN7P+bxtT3DuR1JVlyJ9PJtCElv+PwECM?= =?us-ascii?Q?=3D?= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4efa4417-7c81-4df8-4e0e-08db857fd0f1 X-MS-Exchange-CrossTenant-AuthSource: DM5PR03MB3163.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jul 2023 22:07:02.6243 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR03MB5130 Received-SPF: pass client-ip=2a01:111:f400:7e83::804; envelope-from=Morgan.J.Smith@outlook.com; helo=NAM02-DM3-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx0.migadu.com X-Migadu-Spam-Score: -9.99 X-Spam-Score: -9.99 X-Migadu-Queue-Id: 4D8744D030 X-TUID: h+l/2tmJEfgr * testing/lisp/test-org-agenda.el (test-org-agenda/skip-if): New test. (test-org-agenda/non-scheduled-re-matces): Fix typo by changing name to 'test-org-agenda/non-scheduled-re-matches'. --- testing/lisp/test-org-agenda.el | 62 ++++++++++++++++++++++++++++++++- 1 file changed, 61 insertions(+), 1 deletion(-) diff --git a/testing/lisp/test-org-agenda.el b/testing/lisp/test-org-agenda.el index 22e3106ec..c4bd4f0a7 100644 --- a/testing/lisp/test-org-agenda.el +++ b/testing/lisp/test-org-agenda.el @@ -99,7 +99,7 @@ (looking-at " *agenda-file:Scheduled: *test agenda")))) (org-test-agenda--kill-all-agendas))) -(ert-deftest test-org-agenda/non-scheduled-re-matces () +(ert-deftest test-org-agenda/non-scheduled-re-matches () "Make sure that scheduled-looking elements do not appear in agenda. See https://list.orgmode.org/20220101200103.GB29829@itccanarias.org/T/#t." (cl-assert (not org-agenda-sticky) nil "precondition violation") @@ -269,6 +269,66 @@ See https://list.orgmode.org/06d301d83d9e$f8b44340$ea1cc9c0$@tomdavey.com" (should (not (invisible-p (1- (search-forward "TODO Foo"))))))) (org-toggle-sticky-agenda)) +(ert-deftest test-org-agenda/skip-if () + "Test `org-agenda-skip-if'." + (dolist (options '((scheduled) (notscheduled) + (deadline) (notdeadline) + (timestamp) (nottimestamp) + (regexp "hello") (notregexp "hello") + ;; TODO: Test for specific TODO keywords + (todo ("*")) (nottodo ("*")))) + (should + (equal + (if (memq (car options) '(notscheduled notdeadline nottimestamp regexp nottodo)) + 8 + nil) + (org-test-with-temp-text + "* hello" + (org-agenda-skip-if nil options)))) + (should + (equal + (if (memq (car options) '(scheduled notdeadline timestamp regexp nottodo)) + 36 + nil) + (org-test-with-temp-text + "* hello +SCHEDULED: <2023-07-15 Sat>" + (org-agenda-skip-if nil options)))) + (should + (equal + (if (memq (car options) '(notscheduled deadline timestamp regexp nottodo)) + 35 + nil) + (org-test-with-temp-text + "* hello +DEADLINE: <2023-07-15 Sat>" + (org-agenda-skip-if nil options)))) + (should + (equal + (if (memq (car options) '(notscheduled notdeadline timestamp regexp nottodo)) + 25 + nil) + (org-test-with-temp-text + "* hello +<2023-07-15 Sat>" + (org-agenda-skip-if nil options)))) + (should + (equal + (if (memq (car options) '(notscheduled notdeadline nottimestamp notregexp nottodo)) + 10 + nil) + (org-test-with-temp-text + "* goodbye" + (org-agenda-skip-if nil options)))) + (should + (equal + (if (memq (car options) '(notscheduled notdeadline nottimestamp notregexp todo)) + 26 + nil) + (org-test-with-temp-text + "* TODO write better tests" + (org-agenda-skip-if nil options)))))) + (ert-deftest test-org-agenda/goto-date () "Test `org-agenda-goto-date'." (unwind-protect -- 2.41.0