mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-10-14 05:23:04 +00:00
add: another little test
This commit is contained in:
parent
55eaf62fd3
commit
9927e08d89
@ -34,13 +34,11 @@
|
|||||||
(mirror 1 (if (string-match "%" field-text) "\)" ""))))
|
(mirror 1 (if (string-match "%" field-text) "\)" ""))))
|
||||||
|
|
||||||
(ert-deftest printf-expansion ()
|
(ert-deftest printf-expansion ()
|
||||||
""
|
|
||||||
(with-temp-buffer
|
(with-temp-buffer
|
||||||
(funcall (eval `(make-snippet ,@snippet--printf-snippet-forms)))
|
(funcall (eval `(make-snippet ,@snippet--printf-snippet-forms)))
|
||||||
(should (equal (buffer-string) "printf (\"%s\",)"))))
|
(should (equal (buffer-string) "printf (\"%s\",)"))))
|
||||||
|
|
||||||
(ert-deftest printf-mirrors ()
|
(ert-deftest printf-mirrors ()
|
||||||
""
|
|
||||||
(with-temp-buffer
|
(with-temp-buffer
|
||||||
(funcall (eval `(make-snippet ,@snippet--printf-snippet-forms)))
|
(funcall (eval `(make-snippet ,@snippet--printf-snippet-forms)))
|
||||||
(ert-simulate-command '(delete-forward-char 1))
|
(ert-simulate-command '(delete-forward-char 1))
|
||||||
@ -49,7 +47,6 @@
|
|||||||
(should (equal (buffer-string) "printf (\"%s\",)"))))
|
(should (equal (buffer-string) "printf (\"%s\",)"))))
|
||||||
|
|
||||||
(ert-deftest printf-mirrors-and-navigation ()
|
(ert-deftest printf-mirrors-and-navigation ()
|
||||||
""
|
|
||||||
(with-temp-buffer
|
(with-temp-buffer
|
||||||
(funcall (eval `(make-snippet ,@snippet--printf-snippet-forms)))
|
(funcall (eval `(make-snippet ,@snippet--printf-snippet-forms)))
|
||||||
(ert-simulate-command '(delete-forward-char 1))
|
(ert-simulate-command '(delete-forward-char 1))
|
||||||
@ -59,3 +56,10 @@
|
|||||||
(ert-simulate-command '(snippet-next-field))
|
(ert-simulate-command '(snippet-next-field))
|
||||||
(ert-simulate-command '((lambda () (interactive) (insert "somevar"))))
|
(ert-simulate-command '((lambda () (interactive) (insert "somevar"))))
|
||||||
(should (equal (buffer-string) "printf (\"%s\",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)"))))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user