[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org 711ada5acd 2/2: test-org: Add test for org-todo pre
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org 711ada5acd 2/2: test-org: Add test for org-todo prefix behavior |
Date: |
Sun, 26 Jun 2022 02:57:45 -0400 (EDT) |
branch: externals/org
commit 711ada5acd030f032c865734a238a76500d01364
Author: Allen Li <darkfeline@felesatra.moe>
Commit: Ihor Radchenko <yantar92@gmail.com>
test-org: Add test for org-todo prefix behavior
* testing/lisp/test-org.el (test-org/org-todo-prefix): Add test.
---
testing/lisp/test-org.el | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el
index 121f9efd59..be8c896530 100644
--- a/testing/lisp/test-org.el
+++ b/testing/lisp/test-org.el
@@ -7753,6 +7753,26 @@ CLOSED: %s
(org-add-log-note))
(buffer-string))))))
+(ert-deftest test-org/org-todo-prefix ()
+ "Test `org-todo' prefix arg behavior."
+ ;; FIXME: Add tests for all other allowed prefix arguments.
+ ;; -1 prefix arg should cancel repeater and mark DONE.
+ (should
+ (string-match-p
+ "DONE H\\(.*\n\\)*<2012-03-29 Thu \\+0y>"
+ (let ((org-todo-keywords '((sequence "TODO" "DONE"))))
+ (org-test-with-temp-text "* TODO H\n<2012-03-29 Thu +2y>"
+ (org-todo -1)
+ (buffer-string)))))
+ ;; - prefix arg should cancel repeater and mark DONE.
+ (should
+ (string-match-p
+ "DONE H\\(.*\n\\)*<2012-03-29 Thu \\+0y>"
+ (let ((org-todo-keywords '((sequence "TODO" "DONE"))))
+ (org-test-with-temp-text "* TODO H\n<2012-03-29 Thu +2y>"
+ (org-todo '-)
+ (buffer-string))))))
+
;;; Timestamps API