Переглянути джерело

testing/lisp/test-org.el: Update tests

* testing/lisp/test-org.el
(test-org/open-at-point-in-property): Rename from
`test-org/open-at-point'.  Only test whether
`org-open-at-point' does not throw an error.
(test-org/open-at-point-in-comment)
(test-org/open-at-point/info): New tests.
Bastien Guerry 10 роки тому
батько
коміт
ad567e877b
1 змінених файлів з 22 додано та 10 видалено
  1. 22 10
      testing/lisp/test-org.el

+ 22 - 10
testing/lisp/test-org.el

@@ -924,7 +924,6 @@
      (org-open-at-point)
      (bobp))))
 
-
 ;;;; Link Escaping
 
 (ert-deftest test-org/org-link-escape-ascii-character ()
@@ -1015,20 +1014,33 @@ drops support for Emacs 24.1 and 24.2."
 
 ;;;; Open at point
 
-(ert-deftest test-org/open-at-point ()
-  "Test `org-open-at-point' with link being a heading property."
+(ert-deftest test-org/open-at-point-in-property ()
+  "Does `org-open-at-point' open link in property drawer?"
   (should
-    (org-test-with-temp-text
-	"* Headline
+   (org-test-with-temp-text
+    "* Headline
 :PROPERTIES:
 :URL: <point>[[info:org#Top]]
 :END:"
-      (org-open-at-point)
-      (and (switch-to-buffer "*info*")
-	   (prog1
-	       (looking-at "\nOrg Mode Manual")
-	     (kill-buffer))))))
+    (org-open-at-point) t)))
 
+(ert-deftest test-org/open-at-point-in-comment ()
+  "Does `org-open-at-point' open link in a commented line?"
+  (should
+   (org-test-with-temp-text
+    "# <point>[[info:org#Top]]"
+    (org-open-at-point) t)))
+
+(ert-deftest test-org/open-at-point/info ()
+  "Test `org-open-at-point' on info links."
+  (should
+   (org-test-with-temp-text
+    "<point>[[info:org#Top]]"
+    (org-open-at-point)
+    (and (switch-to-buffer "*info*")
+	 (prog1
+	     (looking-at "\nOrg Mode Manual")
+	   (kill-buffer))))))
 
 
 ;;; Node Properties