[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals-release/org 65f9524136 3/3: test-org-agenda: Test for s
From: |
ELPA Syncer |
Subject: |
[elpa] externals-release/org 65f9524136 3/3: test-org-agenda: Test for scheduled-looking lines |
Date: |
Wed, 12 Jan 2022 08:57:40 -0500 (EST) |
branch: externals-release/org
commit 65f95241367d669cc3e83b1a1733a87f02b28097
Author: Ihor Radchenko <yantar92@gmail.com>
Commit: Ihor Radchenko <yantar92@gmail.com>
test-org-agenda: Test for scheduled-looking lines
* testing/examples/agenda-file.org: Add test headings where SCHEDULED
line is not planning.
*
testing/lisp/test-org-agenda.el (test-org-agenda/non-scheduled-re-matces):
Make sure that SCHEDULED lines that do no belong to planning do not
trigger agenda matches.
See https://list.orgmode.org/20220101200103.GB29829@itccanarias.org/T/#t
---
testing/examples/agenda-file.org | 10 ++++++++++
testing/lisp/test-org-agenda.el | 14 ++++++++++++++
2 files changed, 24 insertions(+)
diff --git a/testing/examples/agenda-file.org b/testing/examples/agenda-file.org
index b3b8725748..5c42cc5794 100644
--- a/testing/examples/agenda-file.org
+++ b/testing/examples/agenda-file.org
@@ -6,3 +6,13 @@ SCHEDULED: <2017-07-19 Wed>
** subnote
* test code 216bc1ff1d862e78183e38ee9a4da504919b9878
<2019-01-08 Tue>
+* test agenda non-scheduled
+#+begin_src org
+SCHEDULED: <2022-01-03 Mon>
+#+end_src
+* colon scheduled entry
+: SCHEDULED: <2022-01-03 Mon>
+* begin_example scheduled entry
+#+begin_example
+SCHEDULED: <2022-01-03 Mon>
+#+end_example
diff --git a/testing/lisp/test-org-agenda.el b/testing/lisp/test-org-agenda.el
index 57cc18b430..f4cf5788b1 100644
--- a/testing/lisp/test-org-agenda.el
+++ b/testing/lisp/test-org-agenda.el
@@ -92,6 +92,20 @@
(looking-at " *agenda-file:Scheduled: *test agenda"))))
(org-test-agenda--kill-all-agendas))
+(ert-deftest test-org-agenda/non-scheduled-re-matces ()
+ "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")
+ (cl-assert (not (org-test-agenda--agenda-buffers))
+ nil "precondition violation")
+ (let ((org-agenda-span 'day)
+ (org-agenda-files `(,(expand-file-name "examples/agenda-file.org"
+ org-test-dir))))
+ (org-agenda-list nil "<2022-01-03 Mon>")
+ (set-buffer org-agenda-buffer-name)
+ (should (= 2 (count-lines (point-min) (point-max)))))
+ (org-test-agenda--kill-all-agendas))
+
(ert-deftest test-org-agenda/set-priority ()
"One informative line in the agenda. Check that org-agenda-priority updates
the agenda."
(cl-assert (not org-agenda-sticky) nil "precondition violation")