mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-09-05 19:42:54 +00:00
test-org-src.el: Add two tests
* testing/lisp/test-org-src.el (test-org-src/preserve-empty-lines): Test that empty lines are not indented. (test-org-src/indented-latex-fragments): Test special edit of multiline indented LaTeX fragment.
This commit is contained in:
parent
f8b0b2babf
commit
73134cfbf1
|
@ -144,6 +144,47 @@ This is a tab:\t.
|
|||
(org-edit-src-exit)
|
||||
(buffer-string))))))
|
||||
|
||||
(ert-deftest test-org-src/preserve-empty-lines ()
|
||||
"Editing block preserves empty lines."
|
||||
(should
|
||||
(equal "
|
||||
#+begin_src emacs-lisp
|
||||
The following line is empty
|
||||
|
||||
abc
|
||||
#+end_src"
|
||||
(org-test-with-temp-text
|
||||
"
|
||||
#+begin_src emacs-lisp
|
||||
The following line is empty
|
||||
|
||||
abc<point>
|
||||
#+end_src"
|
||||
(let ((org-edit-src-content-indentation 2)
|
||||
(org-src-preserve-indentation nil))
|
||||
(org-edit-special)
|
||||
(org-edit-src-exit)
|
||||
(buffer-string)))))
|
||||
(should
|
||||
(equal "
|
||||
#+begin_src emacs-lisp
|
||||
The following line is empty
|
||||
|
||||
abc
|
||||
#+end_src"
|
||||
(org-test-with-temp-text
|
||||
"
|
||||
#+begin_src emacs-lisp
|
||||
The following line is empty
|
||||
<point>
|
||||
abc
|
||||
#+end_src"
|
||||
(let ((org-edit-src-content-indentation 2)
|
||||
(org-src-preserve-indentation nil))
|
||||
(org-edit-special)
|
||||
(org-edit-src-exit)
|
||||
(buffer-string))))))
|
||||
|
||||
(ert-deftest test-org-src/coderef-format ()
|
||||
"Test `org-src-coderef-format' specifications."
|
||||
;; Regular tests in a src block, an example block and an edit
|
||||
|
@ -376,6 +417,17 @@ This is a tab:\t.
|
|||
(org-edit-src-exit)
|
||||
(buffer-string))))))
|
||||
|
||||
(ert-deftest test-org-src/indented-latex-fragments ()
|
||||
"Test editing multiline indented LaTeX fragment."
|
||||
(should
|
||||
(equal
|
||||
"- Item $abc\n efg$"
|
||||
(org-test-with-temp-text
|
||||
"- Item $abc<point>\n efg$"
|
||||
(org-edit-special)
|
||||
(org-edit-src-exit)
|
||||
(buffer-string)))))
|
||||
|
||||
(ert-deftest test-org-src/footnote-references ()
|
||||
"Test editing footnote references."
|
||||
;; Error when there is no definition to edit.
|
||||
|
|
Loading…
Reference in a new issue