From 9927e08d89b5374fefd1d0a76e529ff3da98f10c Mon Sep 17 00:00:00 2001 From: Joao Tavora Date: Thu, 17 Oct 2013 18:50:59 +0100 Subject: [PATCH] add: another little test --- snippet-tests.el | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/snippet-tests.el b/snippet-tests.el index 66deb61..521079a 100644 --- a/snippet-tests.el +++ b/snippet-tests.el @@ -34,13 +34,11 @@ (mirror 1 (if (string-match "%" field-text) "\)" "")))) (ert-deftest printf-expansion () - "" (with-temp-buffer (funcall (eval `(make-snippet ,@snippet--printf-snippet-forms))) (should (equal (buffer-string) "printf (\"%s\",)")))) (ert-deftest printf-mirrors () - "" (with-temp-buffer (funcall (eval `(make-snippet ,@snippet--printf-snippet-forms))) (ert-simulate-command '(delete-forward-char 1)) @@ -49,7 +47,6 @@ (should (equal (buffer-string) "printf (\"%s\",)")))) (ert-deftest printf-mirrors-and-navigation () - "" (with-temp-buffer (funcall (eval `(make-snippet ,@snippet--printf-snippet-forms))) (ert-simulate-command '(delete-forward-char 1)) @@ -59,3 +56,10 @@ (ert-simulate-command '(snippet-next-field)) (ert-simulate-command '((lambda () (interactive) (insert "somevar")))) (should (equal (buffer-string) "printf (\"%s\",somevar)")))) + +(ert-deftest printf-jump-to-second-field-right-away () + (with-temp-buffer + (funcall (eval `(make-snippet ,@snippet--printf-snippet-forms))) + (ert-simulate-command '(snippet-next-field)) + (ert-simulate-command '((lambda () (interactive) (insert "somevar")))) + (should (equal (buffer-string) "printf (\"%s\",somevar)"))))