Browse Source

test-org-agenda: Test diary inclusion

* testing/lisp/test-org-agenda.el (test-org-agenda/diary-inclusion):
  New test.
Marco Wahl 10 months ago
parent
commit
c006a60fac
3 changed files with 21 additions and 0 deletions
  1. 2 0
      testing/examples/agenda-file.org
  2. 1 0
      testing/examples/diary-file
  3. 18 0
      testing/lisp/test-org-agenda.el

+ 2 - 0
testing/examples/agenda-file.org

@@ -4,3 +4,5 @@
 * test agenda
 SCHEDULED: <2017-07-19 Wed>
 ** subnote
+* test code 216bc1ff1d862e78183e38ee9a4da504919b9878
+<2019-01-08 Tue>

+ 1 - 0
testing/examples/diary-file

@@ -0,0 +1 @@
+2019-01-08 test code: f0bcf0cd8bad93c1451bb6e1b2aaedef5cce7cbb

+ 18 - 0
testing/lisp/test-org-agenda.el

@@ -162,6 +162,24 @@
    (org-test-agenda--kill-all-agendas)))
 
 
+(ert-deftest test-org-agenda/diary-inclusion ()
+  "Diary inclusion happens."
+  (org-test-agenda--kill-all-agendas)
+  (let ((diary-file (expand-file-name "examples/diary-file" org-test-dir))
+	(org-agenda-files `(,(expand-file-name "examples/agenda-file.org"
+					       org-test-dir)))
+	(diary-date-forms '((month "[-/]" day "[^-/0-9]")
+			    (year "[-/]" month "[-/]" day "[^0-9]")
+			    (monthname " *" day "[^-0-9]")
+			    (year " *" monthname " *" day "[^0-9]")
+			    (dayname "\\W")))
+	(org-agenda-span 'day)
+	(org-agenda-include-diary t))
+    (org-agenda-list nil "<2019-01-08>")
+    (should (search-forward "f0bcf0cd8bad93c1451bb6e1b2aaedef5cce7cbb" nil t))
+    (org-test-agenda--kill-all-agendas)))
+
+
 (provide 'test-org-agenda)
 
 ;;; test-org-agenda.el ends here