Test expansion in an empty buffer

* yasnippet-tests.el (yas-should-expand, yas-should-not-expand): Call
`erase-buffer' instead of narrowing.
This commit is contained in:
Noam Postavsky 2016-04-12 21:37:17 -04:00
parent a87ec549a6
commit 14f830a37d

View File

@ -851,7 +851,7 @@ add the snippets associated with the given mode."
(defun yas-should-expand (keys-and-expansions)
(dolist (key-and-expansion keys-and-expansions)
(yas-exit-all-snippets)
(narrow-to-region (point) (point))
(erase-buffer)
(insert (car key-and-expansion))
(let ((yas-fallback-behavior nil))
(ert-simulate-command '(yas-expand)))
@ -865,7 +865,7 @@ add the snippets associated with the given mode."
(defun yas-should-not-expand (keys)
(dolist (key keys)
(yas-exit-all-snippets)
(narrow-to-region (point) (point))
(erase-buffer)
(insert key)
(let ((yas-fallback-behavior nil))
(ert-simulate-command '(yas-expand)))