mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-10-13 21:13:04 +00:00
test middle-of-buffer snippet insertion
This commit is contained in:
parent
51e9e8e53c
commit
5c76a0fda2
@ -213,6 +213,15 @@
|
|||||||
(yas-expand-snippet snippet)
|
(yas-expand-snippet snippet)
|
||||||
(should (string= (yas--buffer-contents) "#include <foo>\nmain")))))
|
(should (string= (yas--buffer-contents) "#include <foo>\nmain")))))
|
||||||
|
|
||||||
|
(ert-deftest middle-of-buffer-snippet-insertion ()
|
||||||
|
(with-temp-buffer
|
||||||
|
(yas-minor-mode 1)
|
||||||
|
(insert "beginning")
|
||||||
|
(save-excursion (insert "end"))
|
||||||
|
(let ((snippet "-middle-"))
|
||||||
|
(yas-expand-snippet snippet))
|
||||||
|
(should (string= (yas--buffer-contents) "beginning-middle-end"))))
|
||||||
|
|
||||||
(ert-deftest another-example-for-issue-271 ()
|
(ert-deftest another-example-for-issue-271 ()
|
||||||
;; expect this to fail in batch mode since `region-active-p' doesn't
|
;; expect this to fail in batch mode since `region-active-p' doesn't
|
||||||
;; used by `yas-expand-snippet' doesn't make sense in that context.
|
;; used by `yas-expand-snippet' doesn't make sense in that context.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user