test middle-of-buffer snippet insertion

This commit is contained in:
Noam Postavsky 2013-10-14 11:45:40 -04:00
parent 51e9e8e53c
commit 5c76a0fda2

View File

@ -213,6 +213,15 @@
(yas-expand-snippet snippet)
(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 ()
;; 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.