branch: externals/org
commit 679b4b41df246a222bf059e40d57fb3f082646cd
Author: Ihor Radchenko <[email protected]>
Commit: Ihor Radchenko <[email protected]>
test-org-element/copy: Avoid relying upon constants being `eq'
* testing/lisp/test-org-element.el (test-org-element/copy): Properly
handle compiler warning by explicitly comparing list objects rather
than implictly relying on the compiler allocating both instances of
'("test") to the same object.
Reported-by: Stefan Monnier <[email protected]>
Link: https://yhetil.org/emacs-devel/[email protected]/
---
testing/lisp/test-org-element.el | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/testing/lisp/test-org-element.el b/testing/lisp/test-org-element.el
index 1bddb4053c..3b9c2ea6d4 100644
--- a/testing/lisp/test-org-element.el
+++ b/testing/lisp/test-org-element.el
@@ -811,9 +811,8 @@ Some other text
(should-not (org-element-copy nil))
;; Return a copy secondary strings.
(should (equal '("text") (org-element-copy '("text"))))
- (with-suppressed-warnings ((suspicious eq))
- (should-not
- (eq '("text") (org-element-copy '("text")))))
+ (let ((secondary (list "test")))
+ (should-not (eq secondary (org-element-copy secondary))))
;; Do not alter the source.
(org-test-with-temp-text "*bold*"
(let* ((source (org-element-context))