Sfoglia il codice sorgente

Add test for `org-refile-get-targets'

* testing/lisp/test-org.el (test-org/refile-get-targets): Add test.
Nicolas Goaziou 8 anni fa
parent
commit
36a091fe67
1 ha cambiato i file con 8 aggiunte e 1 eliminazioni
  1. 8 1
      testing/lisp/test-org.el

+ 8 - 1
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