[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org aa3980dd7f 2/2: test-org/return: Add test clauses f
|
From: |
ELPA Syncer |
|
Subject: |
[elpa] externals/org aa3980dd7f 2/2: test-org/return: Add test clauses for `org-return' at citations |
|
Date: |
Thu, 25 May 2023 08:59:09 -0400 (EDT) |
branch: externals/org
commit aa3980dd7f41c52a38d08cff2a1b66881786a443
Author: Ihor Radchenko <yantar92@posteo.net>
Commit: Ihor Radchenko <yantar92@posteo.net>
test-org/return: Add test clauses for `org-return' at citations
* testing/lisp/test-org.el (test-org/return): Add new tests checking
new functionality of `org-return' at citations and citation
references.
---
testing/lisp/test-org.el | 32 +++++++++++++++++++++++++++++++-
1 file changed, 31 insertions(+), 1 deletion(-)
diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el
index 0c5128807e..54f0b87f3e 100644
--- a/testing/lisp/test-org.el
+++ b/testing/lisp/test-org.el
@@ -1646,7 +1646,37 @@ CLOCK: [2022-09-17 sam. 11:00]--[2022-09-17 sam. 11:46]
=> 0:46"
(setq-local fill-column 10)
(auto-fill-mode 1)
(org-return)
- (buffer-string)))))
+ (buffer-string))))
+ ;; When `org-return-follows-link' is non-nil, run `org-open-at-point'
+ ;; on citation.
+ (should
+ (org-test-with-temp-text "[c<point>ite: @key1; @key2]"
+ (catch :called
+ (cl-letf (((symbol-function 'org-open-at-point)
+ (lambda (&rest _) (interactive) (throw :called t))))
+ (let ((org-return-follows-link t)) (org-return))
+ nil))))
+ (should-not
+ (org-test-with-temp-text "[c<point>ite: @key1; @key2]"
+ (catch :called
+ (cl-letf (((symbol-function 'org-open-at-point)
+ (lambda (&rest _) (interactive) (throw :called t))))
+ (let ((org-return-follows-link nil)) (org-return))
+ nil))))
+ (should
+ (org-test-with-temp-text "[cite: @k<point>ey1; @key2]"
+ (catch :called
+ (cl-letf (((symbol-function 'org-open-at-point)
+ (lambda (&rest _) (interactive) (throw :called t))))
+ (let ((org-return-follows-link t)) (org-return))
+ nil))))
+ (should-not
+ (org-test-with-temp-text "[cite: @k<point>ey1; @key2]"
+ (catch :called
+ (cl-letf (((symbol-function 'org-open-at-point)
+ (lambda (&rest _) (interactive) (throw :called t))))
+ (let ((org-return-follows-link nil)) (org-return))
+ nil)))))
(ert-deftest test-org/with-electric-indent ()
"Test RET and C-j specifications with `electric-indent-mode' on."