branch: master commit 1fc34266a4b26909c5d3b3b06632be89cd7c4ced Author: Noam Postavsky <npost...@users.sourceforge.net> Commit: Noam Postavsky <npost...@users.sourceforge.net>
Add test relying on overlay hook inhibition in `yas-expand-snippet' * yasnippet-tests.el (insert-snippet-with-backslashes-in-active-field): New test. --- yasnippet-tests.el | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/yasnippet-tests.el b/yasnippet-tests.el index fc66de3..f9195db 100644 --- a/yasnippet-tests.el +++ b/yasnippet-tests.el @@ -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)