Skip to content

Commit

Permalink
Fix a test to account for newer versions of Org (Emacs >= 30)
Browse files Browse the repository at this point in the history
* test/jupyter-test.el (jupyter-org-result): Don't rely on knowing the
exact structure of an Org element.
  • Loading branch information
nnicandro committed Nov 18, 2024
1 parent be52a62 commit 7bd6390
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions test/jupyter-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -2106,15 +2106,19 @@ Image(filename='%s', width=300)" file)
(ert-deftest jupyter-org-result ()
:tags '(org)
(let ((req (jupyter-org-request)))
(should (equal (jupyter-org-result req (list :text/plain "foo"))
'(fixed-width (:value "foo"))))
(should (equal (jupyter-org-result req (list :text/html "foo"))
'(export-block (:type "html" :value "foo\n"))))
(let ((res (jupyter-org-result req (list :text/plain "foo"))))
(should (eq (org-element-type res) 'fixed-width))
(should (equal (org-element-property :value res) "foo")))
(let ((res (jupyter-org-result req (list :text/html "foo"))))
(should (eq (org-element-type res) 'export-block))
(should (equal (org-element-property :type res) "html"))
(should (equal (org-element-property :value res) "foo\n")))
;; Calls `org-babel-script-escape' for scalar data
(should (equal (jupyter-org-result req (list :text/plain "[1, 2, 3]"))
"| 1 | 2 | 3 |\n"))
(should (equal (jupyter-org-result req (list :text/plain "[1, 2, 3] Foo"))
'(fixed-width (:value "[1, 2, 3] Foo"))))))
(let ((res (jupyter-org-result req (list :text/plain "[1, 2, 3] Foo"))))
(should (eq (org-element-type res) 'fixed-width))
(should (equal (org-element-property :value res) "[1, 2, 3] Foo")))))

(ert-deftest jupyter-org-request-at-point ()
:tags '(org)
Expand Down

0 comments on commit 7bd6390

Please sign in to comment.