aboutsummaryrefslogtreecommitdiff
path: root/tests/test-org-agenda-config-add-files.el
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test-org-agenda-config-add-files.el')
-rw-r--r--tests/test-org-agenda-config-add-files.el12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test-org-agenda-config-add-files.el b/tests/test-org-agenda-config-add-files.el
index e977cc68..8c6f2a69 100644
--- a/tests/test-org-agenda-config-add-files.el
+++ b/tests/test-org-agenda-config-add-files.el
@@ -7,6 +7,7 @@
;;; Code:
(require 'ert)
+(require 'cl-lib)
(add-to-list 'load-path (expand-file-name "tests" user-emacs-directory))
(require 'testutil-general)
@@ -129,5 +130,16 @@
(should (member "/existing/file.org" org-agenda-files))))
(cj/delete-test-base-dir)))
+(ert-deftest test-org-agenda-config-add-files-boundary-missing-dir-warns-not-errors ()
+ "Boundary: a missing project directory warns and adds nothing, without erroring.
+Previously `directory-files' on a missing dir crashed the agenda build."
+ (let ((org-agenda-files '("/existing/file.org"))
+ (warned nil))
+ (cl-letf (((symbol-function 'display-warning)
+ (lambda (&rest _) (setq warned t))))
+ (cj/add-files-to-org-agenda-files-list "/no/such/cj-agenda/dir/"))
+ (should warned)
+ (should (equal org-agenda-files '("/existing/file.org")))))
+
(provide 'test-org-agenda-config-add-files)
;;; test-org-agenda-config-add-files.el ends here