summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDima Gerasimov <karlicoss@gmail.com>2018-10-13 14:31:13 +0100
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2018-10-13 16:58:33 +0200
commit7a09c33867282adaa71954be76580192e4c25075 (patch)
treefd3a2cb3ce4e8717daf2bac3c3ff0a1e3086d107
parentd9fdc204cccda4ff737e0cdcfa96e7e248996131 (diff)
downloadorg-mode-7a09c33867282adaa71954be76580192e4c25075.tar.gz
org-agenda: New test for setting priority
* testing/examples/agenda-file.org: Add a subnote, make sure it has no impact on agenda. * testing/lisp/test-org-agenda.el (test-org-agenda/set-priority): New test. TINYCHANGE
-rw-r--r--testing/examples/agenda-file.org1
-rw-r--r--testing/lisp/test-org-agenda.el17
2 files changed, 18 insertions, 0 deletions
diff --git a/testing/examples/agenda-file.org b/testing/examples/agenda-file.org
index 6579b1c..1c72649 100644
--- a/testing/examples/agenda-file.org
+++ b/testing/examples/agenda-file.org
@@ -3,3 +3,4 @@
<2017-03-10 Fri>
* test agenda
SCHEDULED: <2017-07-19 Wed>
+** subnote
diff --git a/testing/lisp/test-org-agenda.el b/testing/lisp/test-org-agenda.el
index 6aaa88f..b28e122 100644
--- a/testing/lisp/test-org-agenda.el
+++ b/testing/lisp/test-org-agenda.el
@@ -85,6 +85,23 @@
(looking-at " *agenda-file:Scheduled: *test agenda"))))
(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")
+ (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 "<2017-07-19 Wed>")
+ (set-buffer org-agenda-buffer-name)
+
+ (should
+ (progn (goto-line 3)
+ (org-agenda-priority ?B)
+ (looking-at-p " *agenda-file:Scheduled: *\\[#B\\] test agenda"))))
+ (org-test-agenda--kill-all-agendas))
+
(ert-deftest test-org-agenda/sticky-agenda-name ()
"Agenda buffer name after having created one sticky agenda buffer."
(cl-assert (not org-agenda-sticky) nil "precondition violation")