branch: master
commit 9c9952c19a1ed4c28e303a9903f77d9b998876e3
Author: Noam Postavsky <npost...@users.sourceforge.net>
Commit: Noam Postavsky <npost...@users.sourceforge.net>

    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