[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 760f77a 12/42: Test for mirroring more than one field
From: |
Noam Postavsky |
Subject: |
[elpa] master 760f77a 12/42: Test for mirroring more than one field |
Date: |
Sun, 22 Dec 2019 17:37:58 -0500 (EST) |
branch: master
commit 760f77afb9d98f39130f058b4002ed00cd009bad
Author: Kofi Laing <address@hidden>
Commit: Noam Postavsky <address@hidden>
Test for mirroring more than one field
* yasnippet-tests.el (yas-mirror-many-fields): New test.
---
yasnippet-tests.el | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/yasnippet-tests.el b/yasnippet-tests.el
index 95606f2..cccd54c 100644
--- a/yasnippet-tests.el
+++ b/yasnippet-tests.el
@@ -193,6 +193,20 @@ attention to case differences."
(should (string= (yas--buffer-contents)
"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 ()
"Test interaction of autofill with mirror transforms"
(let ((words "one two three four five")
- [elpa] master fc33b2f 28/42: Make overlay-modification protection optional, (continued)
- [elpa] master fc33b2f 28/42: Make overlay-modification protection optional, Noam Postavsky, 2019/12/22
- [elpa] master 048d030 22/42: Fix line-relative snapshotting for org src blocks, Noam Postavsky, 2019/12/22
- [elpa] master bae20af 27/42: ; * doc/faq.org: Linkify bug reference., Noam Postavsky, 2019/12/22
- [elpa] master ffc733d 09/42: ; Debug code fixes, Noam Postavsky, 2019/12/22
- [elpa] master 1d96da2 18/42: Don't call before/after change-functions twice, Noam Postavsky, 2019/12/22
- [elpa] master 6a3619b 23/42: Fix additional corner case with org source block integration, Noam Postavsky, 2019/12/22
- [elpa] master 9cedd59 25/42: Allow disabling snippet keybindings from hook, Noam Postavsky, 2019/12/22
- [elpa] master 55c448b 32/42: Remove redundant arg to yas-expand-snippet, Noam Postavsky, 2019/12/22
- [elpa] master 189f737 26/42: * doc/faq.org: Note that Flyspell problem is (now fixed) Emacs bug., Noam Postavsky, 2019/12/22
- [elpa] master ffce236 30/42: Do auto indentation only in post command hook, Noam Postavsky, 2019/12/22
- [elpa] master 760f77a 12/42: Test for mirroring more than one field,
Noam Postavsky <=
- [elpa] master 0f05a75 14/42: Add yas-completing-read, Noam Postavsky, 2019/12/22
- [elpa] master 03aa561 19/42: * doc/snippet-organization.org: Fix typo., Noam Postavsky, 2019/12/22
- [elpa] master 9f51cf2 17/42: Register snippet movement comments for eldoc, Noam Postavsky, 2019/12/22
- [elpa] master 6a738b5 29/42: ; doc/faq.org: Fix example keybinding code., Noam Postavsky, 2019/12/22
- [elpa] master 476bc77 35/42: Fix snippet undo, Noam Postavsky, 2019/12/22
- [elpa] master c432e78 31/42: Fix field adjustment on deletion, Noam Postavsky, 2019/12/22
- [elpa] master f056a4d 33/42: Minor code shuffling and commenting, Noam Postavsky, 2019/12/22
- [elpa] master bd3572a 36/42: Handle multiple uses of yas-auto-next, Noam Postavsky, 2019/12/22
- [elpa] master e45e3de 34/42: * doc/faq.org: yas-prev should be yas-prev-field, Noam Postavsky, 2019/12/22
- [elpa] master a66f15e 38/42: Fix yas-insert-snippet for keyless snippets, Noam Postavsky, 2019/12/22