[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 4142fb8 108/135: Updated tests for new form expansion
From: |
Ian Dunn |
Subject: |
[elpa] master 4142fb8 108/135: Updated tests for new form expansion |
Date: |
Mon, 17 Feb 2020 10:53:02 -0500 (EST) |
branch: master
commit 4142fb8bd9befa32741b7b535f943ef7caba9f78
Author: Ian Dunn <address@hidden>
Commit: Ian Dunn <address@hidden>
Updated tests for new form expansion
* org-edna-tests.el (org-edna-action-scheduled/landing-no-hour): New test to
ensure landing doesn't mess with assigned time.
---
org-edna-tests.el | 40 ++++++++++++++++++++++++++++++++--------
1 file changed, 32 insertions(+), 8 deletions(-)
diff --git a/org-edna-tests.el b/org-edna-tests.el
index 0a9ddca..827e242 100644
--- a/org-edna-tests.el
+++ b/org-edna-tests.el
@@ -270,7 +270,7 @@
'(let ((targets1 nil)
(consideration1 nil)
(blocking-entry1 nil))
- (setq targets1 (org-edna--add-targets targets1
(org-edna-finder/self)))
+ (setq targets1 (org-edna--add-targets targets1
(org-edna--handle-finder 'org-edna-finder/self 'nil)))
(setq blocking-entry1
(or blocking-entry1
(org-edna--handle-condition 'org-edna-condition/done?
@@ -303,7 +303,7 @@
(blocking-entry2 blocking-entry1))
(setq targets2
(org-edna--add-targets targets2
- (org-edna-finder/match
"checklist")))
+ (org-edna--handle-finder
'org-edna-finder/match '("checklist"))))
(org-edna--handle-action 'org-edna-action/todo!
targets2
(point-marker)
@@ -313,7 +313,7 @@
(blocking-entry5 blocking-entry1))
(setq targets5
(org-edna--add-targets targets5
- (org-edna-finder/siblings)))
+ (org-edna--handle-finder
'org-edna-finder/siblings 'nil)))
(org-edna--handle-action 'org-edna-action/todo!
targets5
(point-marker)
@@ -355,7 +355,7 @@
;; Add targets for checklist match
(setq targets3
(org-edna--add-targets targets3
- (org-edna-finder/match
"checklist")))
+ (org-edna--handle-finder
'org-edna-finder/match '("checklist"))))
;; Handle condition
(setq blocking-entry3
(or blocking-entry3
@@ -365,7 +365,7 @@
;; Add targets for self finder
(setq targets1
(org-edna--add-targets targets1
- (org-edna-finder/self)))
+ (org-edna--handle-finder
'org-edna-finder/self 'nil)))
;; Mark as TODO
(org-edna--handle-action 'org-edna-action/todo! targets1
(point-marker)
@@ -375,7 +375,7 @@
;; Find siblings
(setq targets1
(org-edna--add-targets targets1
- (org-edna-finder/siblings)))
+ (org-edna--handle-finder
'org-edna-finder/siblings 'nil)))
;; Mark as DONE
(org-edna--handle-action 'org-edna-action/todo! targets1
(point-marker)
@@ -416,7 +416,7 @@
;; Add targets for checklist match
(setq targets3
(org-edna--add-targets targets3
- (org-edna-finder/match
"checklist")))
+ (org-edna--handle-finder
'org-edna-finder/match '("checklist"))))
;; Handle condition
(setq blocking-entry3
(or blocking-entry3
@@ -426,7 +426,7 @@
;; Add targets for self finder
(setq targets1
(org-edna--add-targets targets1
- (org-edna-finder/self)))
+ (org-edna--handle-finder
'org-edna-finder/self 'nil)))
;; Mark as TODO
(org-edna--handle-action 'org-edna-action/todo! targets1
(point-marker)
@@ -1198,6 +1198,30 @@
(should (string-equal (org-entry-get nil "SCHEDULED")
"<2000-01-15 Sat 00:00>")))))
+(ert-deftest org-edna-action-scheduled/landing-no-hour ()
+ "Test landing arguments to scheduled increment, without hour."
+ ;; Override `current-time' so we can get a deterministic value
+ (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-time))
+ (org-agenda-files `(,org-edna-test-file))
+ (target (org-id-find "caf27724-0887-4565-9765-ed2f1edcfb16" t)))
+ (org-with-point-at target
+ ;; Time starts at Jan 1, 2017
+ (org-edna-action/scheduled! nil "2017-01-01 Sun")
+ (should (string-equal (org-entry-get nil "SCHEDULED")
+ "<2017-01-01 Sun>"))
+ ;; Move forward 10 days, then backward until we find a weekend
+ (org-edna-action/scheduled! nil "+10d -wknd")
+ (should (string-equal (org-entry-get nil "SCHEDULED")
+ "<2017-01-08 Sun>"))
+ ;; Move forward one week, then forward until we find a weekday
+ (org-edna-action/scheduled! nil "+1w +wkdy")
+ (should (string-equal (org-entry-get nil "SCHEDULED")
+ "<2017-01-16 Mon>"))
+ ;; Back to Saturday for other tests
+ (org-edna-action/scheduled! nil "2017-01-01 Sun")
+ (should (string-equal (org-entry-get nil "SCHEDULED")
+ "<2017-01-01 Sun>")))))
+
(ert-deftest org-edna-action-scheduled/float ()
(cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-time))
(org-agenda-files `(,org-edna-test-file))
- [elpa] master 3c6b66c 075/135: Added next-sibling-wrap finder, (continued)
- [elpa] master 3c6b66c 075/135: Added next-sibling-wrap finder, Ian Dunn, 2020/02/17
- [elpa] master 0503710 080/135: Bumped version to beta1, Ian Dunn, 2020/02/17
- [elpa] master 7d30f60 088/135: Catch non-existent timestamps in planning action, Ian Dunn, 2020/02/17
- [elpa] master d0f7e21 085/135: Added two new forms for setting planning information, Ian Dunn, 2020/02/17
- [elpa] master f45f911 115/135: Mention consider in opening of Consideration section, Ian Dunn, 2020/02/17
- [elpa] master c4d1298 099/135: Added new forms for set-property! and fixed up build system, Ian Dunn, 2020/02/17
- [elpa] master 5cacf20 078/135: Updated documentation, Ian Dunn, 2020/02/17
- [elpa] master bad787d 128/135: Bumped version, Ian Dunn, 2020/02/17
- [elpa] master 6869846 130/135: Merged fix., Ian Dunn, 2020/02/17
- [elpa] master c50f484 106/135: Implemented finder cache, Ian Dunn, 2020/02/17
- [elpa] master 4142fb8 108/135: Updated tests for new form expansion,
Ian Dunn <=
- [elpa] master 2354cde 118/135: Fixed up description of set-effort!., Ian Dunn, 2020/02/17
- [elpa] master 97b6600 119/135: Additional tests and minor cleanup, Ian Dunn, 2020/02/17
- [elpa] master 94edf14 120/135: Added timestamp sorting to relatives finder, Ian Dunn, 2020/02/17
- [elpa] master 1b05e1e 131/135: Fixed failing tests, Ian Dunn, 2020/02/17
- [elpa] master 3647cf7 095/135: Overhauled parsing method, and added conditional blocks, Ian Dunn, 2020/02/17
- [elpa] master 6e1f5fb 087/135: Fixed bug in planning action, Ian Dunn, 2020/02/17
- [elpa] master 2e8b7eb 094/135: Don't export special strings for documentation, Ian Dunn, 2020/02/17
- [elpa] master a3183b2 105/135: Bumped version, Ian Dunn, 2020/02/17
- [elpa] master a2da465 107/135: Bumped version, Ian Dunn, 2020/02/17
- [elpa] master b72cb7b 101/135: Cleaned up Changelog some more, Ian Dunn, 2020/02/17