Skip to content

Commit

Permalink
Add test relying on overlay hook inhibition in `yas-expand-snippet'
Browse files Browse the repository at this point in the history
* yasnippet-tests.el
(insert-snippet-with-backslashes-in-active-field): New test.
  • Loading branch information
npostavs committed Sep 23, 2017
1 parent ba4e5c1 commit 1fc3426
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions yasnippet-tests.el
Expand Up @@ -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)
Expand Down

0 comments on commit 1fc3426

Please sign in to comment.