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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master 9c9952c 12/40: Add test for indentation of single line mir


From: Noam Postavsky
Subject: [elpa] master 9c9952c 12/40: Add test for indentation of single line mirrors
Date: Wed, 26 Oct 2016 23:06:32 +0000 (UTC)

branch: master
commit 9c9952c19a1ed4c28e303a9903f77d9b998876e3
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>

    Add test for indentation of single line mirrors
    
    * yasnippet-tests.el (indent-mirrors-on-update): New test.
---
 yasnippet-tests.el |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/yasnippet-tests.el b/yasnippet-tests.el
index 219b2b3..1d56fb8 100644
--- a/yasnippet-tests.el
+++ b/yasnippet-tests.el
@@ -240,6 +240,16 @@ $1   ------------------------")
 XXXXX   ---------------- XXXXX ----
 XXXXX   ------------------------"))))
 
+(ert-deftest indent-mirrors-on-update ()
+  "Check that mirrors are always kept indented."
+  (with-temp-buffer
+    (ruby-mode)
+    (yas-minor-mode 1)
+    (yas-expand-snippet "def $1\n$1\nend")
+    (yas-mock-insert "xxx")
+    ;; Assuming 2 space indent.
+    (should (string= "def xxx\n  xxx\nend" (buffer-string)))))
+
 
 (ert-deftest snippet-with-multiline-mirrors-issue-665 ()
   "In issue 665, a multi-line mirror is attempted."



reply via email to

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