summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2017-05-22 08:21:50 +0200
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2017-05-22 08:21:50 +0200
commit36a091fe67ec7a174bcafef500099e64ee3592e9 (patch)
tree2bbdc52e271c4ce7bcb907d27d0388ac5198475e
parentcadbef99f02a04f6d426654a1957cbd5d5b2c7fe (diff)
downloadorg-mode-36a091fe67ec7a174bcafef500099e64ee3592e9.tar.gz
Add test for `org-refile-get-targets'
* testing/lisp/test-org.el (test-org/refile-get-targets): Add test.
-rw-r--r--testing/lisp/test-org.el9
1 files changed, 8 insertions, 1 deletions
diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el
index 8162b4f..cd75cb7 100644
--- a/testing/lisp/test-org.el
+++ b/testing/lisp/test-org.el
@@ -5395,7 +5395,7 @@ Paragraph<point>"
(org-refile-targets nil))
(mapcar #'car (org-refile-get-targets))))))
;; Return value is the union of the targets according to all the
- ;; defined rules.
+ ;; defined rules. However, prevent duplicates.
(should
(equal '("F2" "F3" "H1")
(org-test-with-temp-text "* TODO H1\n** F2\n*** F3"
@@ -5403,6 +5403,13 @@ Paragraph<point>"
(org-refile-targets `((nil :regexp . "F")
(nil :todo . "TODO"))))
(mapcar #'car (org-refile-get-targets))))))
+ (should
+ (equal '("F3" "H1" "F2")
+ (org-test-with-temp-text "* TODO H1\n** TODO F2\n*** F3"
+ (let ((org-refile-use-outline-path nil)
+ (org-refile-targets `((nil :regexp . "F")
+ (nil :todo . "TODO"))))
+ (mapcar #'car (org-refile-get-targets))))))
;; When `org-refile-use-outline-path' is non-nil, provide targets as
;; paths.
(should