* [PATCH] test-org-agenda: new test for setting priority
@ 2018-10-13 14:11 Dmitrii Gerasimov
2018-10-13 15:06 ` Nicolas Goaziou
0 siblings, 1 reply; 2+ messages in thread
From: Dmitrii Gerasimov @ 2018-10-13 14:11 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1.1: Type: text/plain, Size: 203 bytes --]
Hi. Was investigating what I has thought to be a bug in org-agenda, but
turns out that it's something else in my setup. Ended up with a unit test
in the process, hope it's useful.
--
Dmitrii Gerasimov
[-- Attachment #1.2: Type: text/html, Size: 507 bytes --]
[-- Attachment #2: 0001-test-org-agenda-new-test-for-setting-priority.patch --]
[-- Type: text/x-patch, Size: 2022 bytes --]
From 9076dda07a4a5e55ac07a0ccd943ead51db7b793 Mon Sep 17 00:00:00 2001
From: Dima Gerasimov <karlicoss@gmail.com>
Date: Sat, 13 Oct 2018 14:31:13 +0100
Subject: [PATCH] test-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
---
testing/examples/agenda-file.org | 1 +
testing/lisp/test-org-agenda.el | 17 +++++++++++++++++
2 files changed, 18 insertions(+)
diff --git a/testing/examples/agenda-file.org b/testing/examples/agenda-file.org
index 6579b1cc8..1c7264979 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 6aaa88fc3..b28e122e9 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")
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] test-org-agenda: new test for setting priority
2018-10-13 14:11 [PATCH] test-org-agenda: new test for setting priority Dmitrii Gerasimov
@ 2018-10-13 15:06 ` Nicolas Goaziou
0 siblings, 0 replies; 2+ messages in thread
From: Nicolas Goaziou @ 2018-10-13 15:06 UTC (permalink / raw)
To: Dmitrii Gerasimov; +Cc: emacs-orgmode
Hello,
Dmitrii Gerasimov <karlicoss@gmail.com> writes:
> Hi. Was investigating what I has thought to be a bug in org-agenda, but
> turns out that it's something else in my setup. Ended up with a unit test
> in the process, hope it's useful.
I applied your patch. I added a TINYCHANGE cookie in case you haven't
signed FSF papers already.
Thank you.
--
Nicolas Goaziou
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-10-13 15:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-13 14:11 [PATCH] test-org-agenda: new test for setting priority Dmitrii Gerasimov
2018-10-13 15:06 ` Nicolas Goaziou
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.