mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-10-13 13:13:03 +00:00
Test for mirroring more than one field
* yasnippet-tests.el (yas-mirror-many-fields): New test.
This commit is contained in:
parent
3c0be40e21
commit
760f77afb9
@ -193,6 +193,20 @@ attention to case differences."
|
|||||||
(should (string= (yas--buffer-contents)
|
(should (string= (yas--buffer-contents)
|
||||||
"bla from another BLA"))))
|
"bla from another BLA"))))
|
||||||
|
|
||||||
|
(ert-deftest yas-mirror-many-fields ()
|
||||||
|
(with-temp-buffer
|
||||||
|
(yas-minor-mode 1)
|
||||||
|
(yas-expand-snippet "${1:brother} and ${2:brother} are${1:$(if (string= (yas-field-value 1) (yas-field-value 2)) \" \" \" not \")}the same word")
|
||||||
|
(should (string= (yas--buffer-contents)
|
||||||
|
"brother and brother are the same word"))
|
||||||
|
(yas-mock-insert "bla")
|
||||||
|
(should (string= (yas--buffer-contents)
|
||||||
|
"bla and brother are not the same word"))
|
||||||
|
(ert-simulate-command '(yas-next-field-or-maybe-expand))
|
||||||
|
(yas-mock-insert "bla")
|
||||||
|
(should (string= (yas--buffer-contents)
|
||||||
|
"bla and bla are the same word"))))
|
||||||
|
|
||||||
(ert-deftest mirror-with-transformation-and-autofill ()
|
(ert-deftest mirror-with-transformation-and-autofill ()
|
||||||
"Test interaction of autofill with mirror transforms"
|
"Test interaction of autofill with mirror transforms"
|
||||||
(let ((words "one two three four five")
|
(let ((words "one two three four five")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user