]> code.delx.au - gnu-emacs-elpa/blobdiff - yasnippet-tests.el
Closes #290: problem when advancing the start of a mirror-in-field
[gnu-emacs-elpa] / yasnippet-tests.el
index 9af244b9e8944576e847e1a445887ff535c4989d..62653b0902668c14c86b036cbb7f5d0a74111f32 100644 (file)
     (should (string= (yas--buffer-contents)
                      "brother from another bla!"))))
 
+(ert-deftest mirrors-adjacent-to-fields-with-nested-mirrors ()
+  (with-temp-buffer)
+  (yas-minor-mode 1)
+  (yas-expand-snippet "<%= f.submit \"${1:Submit}\"${2:$(and (yas-text) \", :disable_with => '\")}${2:$1ing...}${2:$(and (yas-text) \"'\")} %>")
+  (should (string= (yas--buffer-contents)
+                   "<%= f.submit \"Submit\", :disable_with => 'Submiting...' %>"))
+  (ert-simulate-command `(yas-mock-insert "Send"))
+  (should (string= (yas--buffer-contents)
+                   "<%= f.submit \"Send\", :disable_with => 'Sending...' %>")))
+
 ;; (ert-deftest in-snippet-undo ()
 ;;   (with-temp-buffer
 ;;     (yas-minor-mode 1)