Pārlūkot izejas kodu

test-org-agenda: Fix failing test and warn about using today's agenda

* testing/lisp/test-org-agenda.el (test-org-agenda/property-timestamp):
Fix test that failed because of different behavior of agenda view
depending whether the view is called today (according to system date)
or not.  Today's agenda (even called with custom date argument)
display the past scheduled items, while it is not the case for
non-today agendas.
* testing/lisp/test-org-agenda.el (test-org-agenda/one-line):
(test-org-agenda/scheduled-non-todo):
(test-org-agenda/non-scheduled-re-matces):
(test-org-agenda/property-timestamp):
(test-org-agenda/diary-inclusion):
(test-org-agenda/set-priority):
Add a note to warn future test developers about potential surprising
agenda behaviour.
Ihor Radchenko 3 gadi atpakaļ
vecāks
revīzija
735f666fad
1 mainītis faili ar 19 papildinājumiem un 3 dzēšanām
  1. 19 3
      testing/lisp/test-org-agenda.el

+ 19 - 3
testing/lisp/test-org-agenda.el

@@ -72,6 +72,9 @@
   (let ((org-agenda-span 'day)
 	(org-agenda-files `(,(expand-file-name "examples/agenda-file.org"
 					       org-test-dir))))
+    ;; NOTE: Be aware that `org-agenda-list' may or may not display
+    ;; past scheduled items depending whether the date is today
+    ;; `org-today' or not.
     (org-agenda-list nil  "<2017-03-10 Fri>")
     (set-buffer org-agenda-buffer-name)
     (should (= 3 (count-lines (point-min) (point-max)))))
@@ -85,6 +88,9 @@
   (let ((org-agenda-span 'day)
 	(org-agenda-files `(,(expand-file-name "examples/agenda-file.org"
 					       org-test-dir))))
+    ;; NOTE: Be aware that `org-agenda-list' may or may not display
+    ;; past scheduled items depending whether the date is today
+    ;; `org-today' or not.
     (org-agenda-list nil "<2017-07-19 Wed>")
     (set-buffer org-agenda-buffer-name)
     (should
@@ -101,6 +107,9 @@ See https://list.orgmode.org/20220101200103.GB29829@itccanarias.org/T/#t."
   (let ((org-agenda-span 'day)
 	(org-agenda-files `(,(expand-file-name "examples/agenda-file.org"
 					       org-test-dir))))
+    ;; NOTE: Be aware that `org-agenda-list' may or may not display
+    ;; past scheduled items depending whether the date is today
+    ;; `org-today' or not.
     (org-agenda-list nil "<2022-01-03 Mon>")
     (set-buffer org-agenda-buffer-name)
     (should (= 2 (count-lines (point-min) (point-max)))))
@@ -115,10 +124,12 @@ See https://list.orgmode.org/06d301d83d9e$f8b44340$ea1cc9c0$@tomdavey.com"
   (let ((org-agenda-span 'day)
 	(org-agenda-files `(,(expand-file-name "examples/agenda-file.org"
 					       org-test-dir))))
+    ;; NOTE: Be aware that `org-agenda-list' may or may not display
+    ;; past scheduled items depending whether the date is today
+    ;; `org-today' or not.
     (org-agenda-list nil "<2022-03-22 Tue>")
     (set-buffer org-agenda-buffer-name)
-    (message "%s" (buffer-string))
-    (should (= 4 (count-lines (point-min) (point-max)))))
+    (should (= 3 (count-lines (point-min) (point-max))))
   (org-test-agenda--kill-all-agendas))
 
 (ert-deftest test-org-agenda/set-priority ()
@@ -129,9 +140,11 @@ See https://list.orgmode.org/06d301d83d9e$f8b44340$ea1cc9c0$@tomdavey.com"
   (let ((org-agenda-span 'day)
 	(org-agenda-files `(,(expand-file-name "examples/agenda-file.org"
 					       org-test-dir))))
+    ;; NOTE: Be aware that `org-agenda-list' may or may not display
+    ;; past scheduled items depending whether the date is today
+    ;; `org-today' or not.
     (org-agenda-list nil "<2017-07-19 Wed>")
     (set-buffer org-agenda-buffer-name)
-
     (should
      (progn (goto-line 3)
 	    (org-agenda-priority ?B)
@@ -224,6 +237,9 @@ See https://list.orgmode.org/06d301d83d9e$f8b44340$ea1cc9c0$@tomdavey.com"
 			    (dayname "\\W")))
 	(org-agenda-span 'day)
 	(org-agenda-include-diary t))
+    ;; NOTE: Be aware that `org-agenda-list' may or may not display
+    ;; past scheduled items depending whether the date is today
+    ;; `org-today' or not.
     (org-agenda-list nil "<2019-01-08>")
     (should (search-forward "f0bcf0cd8bad93c1451bb6e1b2aaedef5cce7cbb" nil t))
     (org-test-agenda--kill-all-agendas)))