]> code.delx.au - gnu-emacs-elpa/commitdiff
add: test for issue #404
authorJoao Tavora <joaotavora@gmail.com>
Mon, 14 Oct 2013 09:25:38 +0000 (10:25 +0100)
committerJoao Tavora <joaotavora@gmail.com>
Mon, 14 Oct 2013 09:25:38 +0000 (10:25 +0100)
yasnippet-tests.el

index 7349d6f1477abda732edaffb6986b6e2eebe3b8b..c5d87387aadc4820c7ed5ee363fb9fac71f97047 100644 (file)
       (ert-simulate-command `(yas-mock-insert "bbb"))
       (should (string= (yas--buffer-contents) "if condition\naaa\nelse\nbbb\nend")))))
 
+(ert-deftest example-for-issue-404 ()
+  (with-temp-buffer
+    (c++-mode)
+    (yas-minor-mode 1)
+    (insert "#include <foo>\n")
+    (let ((snippet "main"))
+      (yas-expand-snippet snippet)
+      (should (string= (yas--buffer-contents) "#include <foo>\nmain")))))
+
 (ert-deftest another-example-for-issue-271 ()
   ;; expect this to fail in batch mode since `region-active-p' doesn't
   ;; used by `yas-expand-snippet' doesn't make sense in that context.