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:
Nicolas Goaziou 2015-01-23 00:24:29 +01:00
parent 53592f4e25
commit a9e4636cbf

View file

@ -29,13 +29,12 @@
"Editing regular block works, with point on source block."
(org-test-with-temp-text
"
#+begin_src emacs-lisp
<point>#+begin_src emacs-lisp
(message hello)
#+end_src
"
(let ((org-edit-src-content-indentation 2)
(org-src-preserve-indentation nil))
(goto-line 2)
(org-edit-special)
(insert "blah")
(org-edit-src-exit)
@ -44,7 +43,7 @@
blah(message hello)
#+end_src
"))
(should (equal (word-at-point) "blah")))))
(should (org-looking-at-p "(message hello)")))))
(ert-deftest test-org-src/point-outside-block ()
"Editing with point before/after block signals expected error."
@ -63,21 +62,21 @@
"Editing empty block."
(org-test-with-temp-text
"
#+begin_src emacs-lisp
<point>#+begin_src emacs-lisp
#+end_src
"
(let ((org-edit-src-content-indentation 2)
(let ((org-edit-src-content-indentation 0)
(org-src-preserve-indentation nil))
(goto-line 2)
(org-edit-special)
(insert "blah")
(org-edit-src-exit)
(should (equal (buffer-string) "
#+begin_src emacs-lisp
blah
blah
#+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 ()
"Editing block with just a blank line."