Skip to content

Commit 7bd6390

Browse files
committed
Fix a test to account for newer versions of Org (Emacs >= 30)
* test/jupyter-test.el (jupyter-org-result): Don't rely on knowing the exact structure of an Org element.
1 parent be52a62 commit 7bd6390

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

test/jupyter-test.el

+10-6
Original file line numberDiff line numberDiff line change
@@ -2106,15 +2106,19 @@ Image(filename='%s', width=300)" file)
21062106
(ert-deftest jupyter-org-result ()
21072107
:tags '(org)
21082108
(let ((req (jupyter-org-request)))
2109-
(should (equal (jupyter-org-result req (list :text/plain "foo"))
2110-
'(fixed-width (:value "foo"))))
2111-
(should (equal (jupyter-org-result req (list :text/html "foo"))
2112-
'(export-block (:type "html" :value "foo\n"))))
2109+
(let ((res (jupyter-org-result req (list :text/plain "foo"))))
2110+
(should (eq (org-element-type res) 'fixed-width))
2111+
(should (equal (org-element-property :value res) "foo")))
2112+
(let ((res (jupyter-org-result req (list :text/html "foo"))))
2113+
(should (eq (org-element-type res) 'export-block))
2114+
(should (equal (org-element-property :type res) "html"))
2115+
(should (equal (org-element-property :value res) "foo\n")))
21132116
;; Calls `org-babel-script-escape' for scalar data
21142117
(should (equal (jupyter-org-result req (list :text/plain "[1, 2, 3]"))
21152118
"| 1 | 2 | 3 |\n"))
2116-
(should (equal (jupyter-org-result req (list :text/plain "[1, 2, 3] Foo"))
2117-
'(fixed-width (:value "[1, 2, 3] Foo"))))))
2119+
(let ((res (jupyter-org-result req (list :text/plain "[1, 2, 3] Foo"))))
2120+
(should (eq (org-element-type res) 'fixed-width))
2121+
(should (equal (org-element-property :value res) "[1, 2, 3] Foo")))))
21182122

21192123
(ert-deftest jupyter-org-request-at-point ()
21202124
:tags '(org)

0 commit comments

Comments
 (0)