forked from mirrors/org-mode
test-org-src: Fix failing tests
* testing/lisp/test-org-src.el (test-org-src/basic, test-org-src/empty-block): Do not rely on `word-at-point'.
This commit is contained in:
parent
53592f4e25
commit
a9e4636cbf
|
@ -29,13 +29,12 @@
|
||||||
"Editing regular block works, with point on source block."
|
"Editing regular block works, with point on source block."
|
||||||
(org-test-with-temp-text
|
(org-test-with-temp-text
|
||||||
"
|
"
|
||||||
#+begin_src emacs-lisp
|
<point>#+begin_src emacs-lisp
|
||||||
(message hello)
|
(message hello)
|
||||||
#+end_src
|
#+end_src
|
||||||
"
|
"
|
||||||
(let ((org-edit-src-content-indentation 2)
|
(let ((org-edit-src-content-indentation 2)
|
||||||
(org-src-preserve-indentation nil))
|
(org-src-preserve-indentation nil))
|
||||||
(goto-line 2)
|
|
||||||
(org-edit-special)
|
(org-edit-special)
|
||||||
(insert "blah")
|
(insert "blah")
|
||||||
(org-edit-src-exit)
|
(org-edit-src-exit)
|
||||||
|
@ -44,7 +43,7 @@
|
||||||
blah(message hello)
|
blah(message hello)
|
||||||
#+end_src
|
#+end_src
|
||||||
"))
|
"))
|
||||||
(should (equal (word-at-point) "blah")))))
|
(should (org-looking-at-p "(message hello)")))))
|
||||||
|
|
||||||
(ert-deftest test-org-src/point-outside-block ()
|
(ert-deftest test-org-src/point-outside-block ()
|
||||||
"Editing with point before/after block signals expected error."
|
"Editing with point before/after block signals expected error."
|
||||||
|
@ -63,12 +62,11 @@
|
||||||
"Editing empty block."
|
"Editing empty block."
|
||||||
(org-test-with-temp-text
|
(org-test-with-temp-text
|
||||||
"
|
"
|
||||||
#+begin_src emacs-lisp
|
<point>#+begin_src emacs-lisp
|
||||||
#+end_src
|
#+end_src
|
||||||
"
|
"
|
||||||
(let ((org-edit-src-content-indentation 2)
|
(let ((org-edit-src-content-indentation 0)
|
||||||
(org-src-preserve-indentation nil))
|
(org-src-preserve-indentation nil))
|
||||||
(goto-line 2)
|
|
||||||
(org-edit-special)
|
(org-edit-special)
|
||||||
(insert "blah")
|
(insert "blah")
|
||||||
(org-edit-src-exit)
|
(org-edit-src-exit)
|
||||||
|
@ -77,7 +75,8 @@
|
||||||
blah
|
blah
|
||||||
#+end_src
|
#+end_src
|
||||||
"))
|
"))
|
||||||
(should (equal (word-at-point) "blah")))))
|
(should
|
||||||
|
(equal (buffer-substring (line-beginning-position) (point)) "blah")))))
|
||||||
|
|
||||||
(ert-deftest test-org-src/blank-line-block ()
|
(ert-deftest test-org-src/blank-line-block ()
|
||||||
"Editing block with just a blank line."
|
"Editing block with just a blank line."
|
||||||
|
|
Loading…
Reference in a new issue