Fix should-buffer! macro for tests
This commit is contained in:
parent
8be3d95f33
commit
e6dd7fa867
1 changed files with 6 additions and 8 deletions
|
@ -121,21 +121,19 @@ against."
|
||||||
(when (equal (caar marker-list) "0")
|
(when (equal (caar marker-list) "0")
|
||||||
(goto-char! 0)))
|
(goto-char! 0)))
|
||||||
,@body
|
,@body
|
||||||
(let ((result-text (buffer-substring-no-properties (point-min) (point-max)))
|
(let ((result-text (buffer-string))
|
||||||
(point (point))
|
(point (point))
|
||||||
same-point
|
|
||||||
expected-text)
|
expected-text)
|
||||||
(with-temp-buffer
|
(with-temp-buffer
|
||||||
(cl-loop for line in ',expected
|
(cl-loop for line in ',expected
|
||||||
do (insert line "\n"))
|
do (insert line "\n"))
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(goto-char 1)
|
(goto-char (point-min))
|
||||||
(when (re-search-forward "{|}" nil t)
|
(when (re-search-forward "{|}" nil t)
|
||||||
(setq same-point (= point (match-beginning 0)))
|
(replace-match "" t t)
|
||||||
(replace-match "" t t)))
|
(should (equal (point) point))))
|
||||||
(setq expected-text (buffer-substring-no-properties (point-min) (point-max)))
|
(setq expected-text (buffer-string))
|
||||||
(should (equal expected-text result-text))
|
(should (equal expected-text result-text))))))))
|
||||||
(should same-point)))))))
|
|
||||||
|
|
||||||
(defmacro goto-char! (index)
|
(defmacro goto-char! (index)
|
||||||
"Meant to be used with `should-buffer!'. Will move the cursor to one of the
|
"Meant to be used with `should-buffer!'. Will move the cursor to one of the
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue