mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-03 12:27:26 -05:00
Fix should-buffer! macro for tests
This commit is contained in:
@ -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
|
||||||
|
Reference in New Issue
Block a user