Add test relying on overlay hook inhibition in `yas-expand-snippet'

* yasnippet-tests.el
(insert-snippet-with-backslashes-in-active-field): New test.
This commit is contained in:
Noam Postavsky 2017-09-23 19:24:34 -04:00
parent ba4e5c1736
commit 1fc34266a4

View File

@ -606,6 +606,14 @@ mapconcat #'(lambda (arg)
(yas-expand-snippet "Look ma! ${1:`(yas-selected-text)`} OK?")
(should (string= (yas--buffer-contents) "Look ma! He)}o world! OK?")))))
(ert-deftest insert-snippet-with-backslashes-in-active-field ()
;; This test case fails if `yas--inhibit-overlay-hooks' is not bound
;; in `yas-expand-snippet' (see Github #844).
(with-temp-buffer
(yas-minor-mode 1)
(yas-expand-snippet "${1:$$(if (not yas-modified-p) \"a\")}")
(yas-expand-snippet "\\\\alpha")))
(ert-deftest example-for-issue-271 ()
(with-temp-buffer
(yas-minor-mode 1)