فهرست منبع

Add test for `org-open-at-point'

* testing/lisp/test-org.el (test-org/open-at-point/tag): New test.
Nicolas Goaziou 7 سال پیش
والد
کامیت
febab2fedb
1فایلهای تغییر یافته به همراه17 افزوده شده و 0 حذف شده
  1. 17 0
      testing/lisp/test-org.el

+ 17 - 0
testing/lisp/test-org.el

@@ -2366,6 +2366,23 @@ http://article.gmane.org/gmane.emacs.orgmode/21459/"
      (org-open-at-point)
      (eq (org-element-type (org-element-context)) 'radio-target))))
 
+(ert-deftest test-org/open-at-point/tag ()
+  "Test `org-open-at-point' on tags."
+  (should
+   (org-test-with-temp-text "* H :<point>tag:"
+     (catch :result
+       (cl-letf (((symbol-function 'org-tags-view)
+		  (lambda (&rest args) (throw :result t))))
+	 (org-open-at-point)
+	 nil))))
+  (should-not
+   (org-test-with-temp-text-in-file "* H<point> :tag:"
+     (catch :result
+       (cl-letf (((symbol-function 'org-tags-view)
+		  (lambda (&rest args) (throw :result t))))
+	 (org-open-at-point)
+	 nil)))))
+
 ;;;; Stored links
 
 (ert-deftest test-org/store-link ()