summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Wahl <marcowahlsoft@gmail.com>2019-01-08 21:32:44 +0100
committerMarco Wahl <marcowahlsoft@gmail.com>2019-01-08 21:32:44 +0100
commitc006a60fac7eaa9a4c4adebfc865f5e299d57b0b (patch)
tree0187458ad2de6651c24c2beaaf3fc3a22688e322
parent8a5d8f79a163f8f7a6fb308f98dc57773cbdfa19 (diff)
downloadorg-mode-c006a60fac7eaa9a4c4adebfc865f5e299d57b0b.tar.gz
test-org-agenda: Test diary inclusion
* testing/lisp/test-org-agenda.el (test-org-agenda/diary-inclusion): New test.
-rw-r--r--testing/examples/agenda-file.org2
-rw-r--r--testing/examples/diary-file1
-rw-r--r--testing/lisp/test-org-agenda.el18
3 files changed, 21 insertions, 0 deletions
diff --git a/testing/examples/agenda-file.org b/testing/examples/agenda-file.org
index 1c72649..b3b8725 100644
--- a/testing/examples/agenda-file.org
+++ b/testing/examples/agenda-file.org
@@ -4,3 +4,5 @@
* test agenda
SCHEDULED: <2017-07-19 Wed>
** subnote
+* test code 216bc1ff1d862e78183e38ee9a4da504919b9878
+<2019-01-08 Tue>
diff --git a/testing/examples/diary-file b/testing/examples/diary-file
new file mode 100644
index 0000000..11745bc
--- /dev/null
+++ b/testing/examples/diary-file
@@ -0,0 +1 @@
+2019-01-08 test code: f0bcf0cd8bad93c1451bb6e1b2aaedef5cce7cbb
diff --git a/testing/lisp/test-org-agenda.el b/testing/lisp/test-org-agenda.el
index a9cbcb8..bdee2bf 100644
--- a/testing/lisp/test-org-agenda.el
+++ b/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