emacs-elpa-diffs
[Top][All Lists]
Advanced

[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")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]