branch: master commit 5c76a0fda29479d4566fded3eff0e55727bd5eb4 Author: Noam Postavsky <npost...@users.sourceforge.net> Commit: Noam Postavsky <npost...@users.sourceforge.net>
test middle-of-buffer snippet insertion --- yasnippet-tests.el | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/yasnippet-tests.el b/yasnippet-tests.el index c5d8738..fd75063 100644 --- a/yasnippet-tests.el +++ b/yasnippet-tests.el @@ -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.