[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org d3d80c5 46/85: Add test checking org-log-done specs
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org d3d80c5 46/85: Add test checking org-log-done specs |
Date: |
Mon, 27 Sep 2021 15:57:47 -0400 (EDT) |
branch: externals/org
commit d3d80c5948444c551216c464295ff9bac3f8414d
Author: Ihor Radchenko <yantar92@gmail.com>
Commit: Bastien <bzg@gnu.org>
Add test checking org-log-done specs
* testing/lisp/test-org.el (test-org/org-log-done): New test
---
testing/lisp/test-org.el | 126 +++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 126 insertions(+)
diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el
index 160968c..18d41a0 100644
--- a/testing/lisp/test-org.el
+++ b/testing/lisp/test-org.el
@@ -7433,6 +7433,132 @@ SCHEDULED: <2021-06-15 Tue +1d>"
(org-add-log-note))
(buffer-string))))))
+(ert-deftest test-org/org-log-done ()
+ "Test `org-log-done' specifications."
+ ;; nil value.
+ (should
+ (string=
+ "* DONE task"
+ (let ((org-log-done nil)
+ (org-todo-keywords '((sequence "TODO" "DONE"))))
+ (org-test-with-temp-text
+ "* TODO task"
+ (org-todo "DONE")
+ (when (memq 'org-add-log-note post-command-hook)
+ (org-add-log-note))
+ (buffer-string)))))
+ ;; `time' value.
+ (should
+ (string=
+ (format
+ "* DONE task
+CLOSED: %s"
+ (org-test-with-temp-text ""
+ (org-insert-time-stamp (current-time) t t)
+ (buffer-string)))
+ (let ((org-log-done 'time)
+ (org-log-done-with-time t)
+ (org-todo-keywords '((sequence "TODO" "DONE"))))
+ (org-test-with-temp-text
+ "* TODO task"
+ (org-todo "DONE")
+ (when (memq 'org-add-log-note post-command-hook)
+ (org-add-log-note))
+ (buffer-string)))))
+ (should
+ (string=
+ (format
+ "* DONE task
+CLOSED: %s"
+ (org-test-with-temp-text ""
+ (org-insert-time-stamp (current-time) nil t)
+ (buffer-string)))
+ (let ((org-log-done 'time)
+ (org-log-done-with-time nil)
+ (org-todo-keywords '((sequence "TODO" "DONE"))))
+ (org-test-with-temp-text
+ "* TODO task"
+ (org-todo "DONE")
+ (when (memq 'org-add-log-note post-command-hook)
+ (org-add-log-note))
+ (buffer-string)))))
+ ;; TODO: Test `note' value.
+ ;; Test startup overrides.
+ (should
+ (string=
+ "#+STARTUP: nologdone
+* DONE task"
+ (let ((org-log-done 'time)
+ (org-todo-keywords '((sequence "TODO" "DONE"))))
+ (org-test-with-temp-text
+ "#+STARTUP: nologdone
+<point>* TODO task"
+ (org-set-regexps-and-options)
+ (org-todo "DONE")
+ (when (memq 'org-add-log-note post-command-hook)
+ (org-add-log-note))
+ (buffer-string)))))
+ (should
+ (string=
+ (format
+ "#+STARTUP: logdone
+* DONE task
+CLOSED: %s"
+ (org-test-with-temp-text ""
+ (org-insert-time-stamp (current-time) t t)
+ (buffer-string)))
+ (let ((org-log-done nil)
+ (org-log-done-with-time t)
+ (org-todo-keywords '((sequence "TODO" "DONE"))))
+ (org-test-with-temp-text
+ "#+STARTUP: logdone
+<point>* TODO task"
+ (org-set-regexps-and-options)
+ (org-todo "DONE")
+ (when (memq 'org-add-log-note post-command-hook)
+ (org-add-log-note))
+ (buffer-string)))))
+ ;; Test local property overrides.
+ (should
+ (string=
+ "* DONE task
+:PROPERTIES:
+:LOGGING: nil
+:END:"
+ (let ((org-log-done 'time)
+ (org-todo-keywords '((sequence "TODO" "DONE"))))
+ (org-test-with-temp-text
+ "* TODO task
+:PROPERTIES:
+:LOGGING: nil
+:END:"
+ (org-todo "DONE")
+ (when (memq 'org-add-log-note post-command-hook)
+ (org-add-log-note))
+ (buffer-string)))))
+ (should
+ (string=
+ (format
+ "* DONE task
+CLOSED: %s
+:PROPERTIES:
+:LOGGING: logdone
+:END:"
+ (org-test-with-temp-text ""
+ (org-insert-time-stamp (current-time) t t)
+ (buffer-string)))
+ (let ((org-log-done nil)
+ (org-log-done-with-time t)
+ (org-todo-keywords '((sequence "TODO" "DONE"))))
+ (org-test-with-temp-text
+ "* TODO task
+:PROPERTIES:
+:LOGGING: logdone
+:END:"
+ (org-todo "DONE")
+ (when (memq 'org-add-log-note post-command-hook)
+ (org-add-log-note))
+ (buffer-string))))))
;;; Timestamps API
- [elpa] externals/org 527da79 18/85: Merge branch 'bugfix', (continued)
- [elpa] externals/org 527da79 18/85: Merge branch 'bugfix', ELPA Syncer, 2021/09/27
- [elpa] externals/org e626185 23/85: org-table.el: Fix usage of user-error, ELPA Syncer, 2021/09/27
- [elpa] externals/org 179ae6b 25/85: Merge branch 'bugfix', ELPA Syncer, 2021/09/27
- [elpa] externals/org a3c912c 26/85: Fix duplicate logbook entry for repeated tasks, ELPA Syncer, 2021/09/27
- [elpa] externals/org 769a557 28/85: Merge branch 'bugfix', ELPA Syncer, 2021/09/27
- [elpa] externals/org 777c1c3 27/85: Merge branch 'bugfix', ELPA Syncer, 2021/09/27
- [elpa] externals/org 74a5af6 31/85: Fix byte-comp function warnings, ELPA Syncer, 2021/09/27
- [elpa] externals/org 4d1a77a 32/85: org-attach: Fix byte-comp function warning, ELPA Syncer, 2021/09/27
- [elpa] externals/org 18f6ef8 33/85: ox.el: add smart quotes for greek, ELPA Syncer, 2021/09/27
- [elpa] externals/org 1c83f6f 47/85: Allow sexps with nested parenthesis in org-agenda-prefix-format, ELPA Syncer, 2021/09/27
- [elpa] externals/org d3d80c5 46/85: Add test checking org-log-done specs,
ELPA Syncer <=
- [elpa] externals/org df51e93 53/85: Merge branch 'bugfix', ELPA Syncer, 2021/09/27
- [elpa] externals/org 72c9f1b 43/85: Merge branch 'bugfix', ELPA Syncer, 2021/09/27
- [elpa] externals/org acc49d5 41/85: Merge branch 'bugfix', ELPA Syncer, 2021/09/27
- [elpa] externals/org 1f3722c 65/85: Backport commit c78e16962 from Emacs, ELPA Syncer, 2021/09/27
- [elpa] externals/org c305bb7 69/85: org-agenda: Allow org-agenda-overriding-header to be a function, ELPA Syncer, 2021/09/27
- [elpa] externals/org 2db02f9 70/85: Merge branch 'bugfix', ELPA Syncer, 2021/09/27
- [elpa] externals/org 177745e 73/85: doc/org-manual.org (Citations handling): New section, ELPA Syncer, 2021/09/27
- [elpa] externals/org 1f2c26a 15/85: Merge branch 'bugfix', ELPA Syncer, 2021/09/27
- [elpa] externals/org 815c0b3 19/85: Merge branch 'bugfix', ELPA Syncer, 2021/09/27
- [elpa] externals/org f5392c4 08/85: Merge branch 'km/from-emacs-master', ELPA Syncer, 2021/09/27