[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master f3d0e03 25/63: * yasnippet-tests.el (snippet-exit-hooks):
From: |
Noam Postavsky |
Subject: |
[elpa] master f3d0e03 25/63: * yasnippet-tests.el (snippet-exit-hooks): New test. |
Date: |
Mon, 17 Jul 2017 22:54:14 -0400 (EDT) |
branch: master
commit f3d0e03a05d3422bbeec1ed57514cc1628181251
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>
* yasnippet-tests.el (snippet-exit-hooks): New test.
---
yasnippet-tests.el | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/yasnippet-tests.el b/yasnippet-tests.el
index a6abcb7..dc0c43c 100644
--- a/yasnippet-tests.el
+++ b/yasnippet-tests.el
@@ -553,6 +553,36 @@ TODO: correct this bug!"
"brother from another mother") ;; no newline should be
here!
)))
+(ert-deftest snippet-exit-hooks ()
+ (defvar yas--ran-exit-hook)
+ (with-temp-buffer
+ (yas-saving-variables
+ (let ((yas--ran-exit-hook nil)
+ (yas-triggers-in-field t))
+ (yas-with-snippet-dirs
+ '((".emacs.d/snippets"
+ ("emacs-lisp-mode"
+ ("foo" . "\
+# expand-env: ((yas-after-exit-snippet-hook (lambda () (setq
yas--ran-exit-hook t))))
+# --
+FOO ${1:f1} ${2:f2}")
+ ("sub" . "\
+# expand-env: ((yas-after-exit-snippet-hook (lambda () (setq
yas--ran-exit-hook 'sub))))
+# --
+SUB"))))
+ (yas-reload-all)
+ (emacs-lisp-mode)
+ (yas-minor-mode +1)
+ (insert "foo")
+ (ert-simulate-command '(yas-expand))
+ (should-not yas--ran-exit-hook)
+ (yas-mock-insert "sub")
+ (ert-simulate-command '(yas-expand))
+ (ert-simulate-command '(yas-next-field))
+ (should-not yas--ran-exit-hook)
+ (ert-simulate-command '(yas-next-field))
+ (should (eq yas--ran-exit-hook t)))))))
+
(defvar yas--barbaz)
(defvar yas--foobarbaz)
- [elpa] master c485d13 04/63: Remove last use of flet, (continued)
- [elpa] master c485d13 04/63: Remove last use of flet, Noam Postavsky, 2017/07/17
- [elpa] master 80a1098 02/63: Rework yas-reload-all message introduced by #744, Noam Postavsky, 2017/07/17
- [elpa] master 28d5496 11/63: Use git describe for doc HTML output, Noam Postavsky, 2017/07/17
- [elpa] master cce2e0d 09/63: Make the documentation build reproducible, Noam Postavsky, 2017/07/17
- [elpa] master 2ca6321 05/63: Promote yas--snippets-at-point to a public API, Noam Postavsky, 2017/07/17
- [elpa] master 9abf842 19/63: Enable snippet-mode automatically, Noam Postavsky, 2017/07/17
- [elpa] master 48cd716 14/63: Use more compact format for snippet menus, Noam Postavsky, 2017/07/17
- [elpa] master b62cf52 23/63: Remove lambda list building hack, Noam Postavsky, 2017/07/17
- [elpa] master 7b3c29d 13/63: * doc/faq.org: Typos and grammar., Noam Postavsky, 2017/07/17
- [elpa] master 14819c9 28/63: Make yas-buffer-local-condition into a defcustom, Noam Postavsky, 2017/07/17
- [elpa] master f3d0e03 25/63: * yasnippet-tests.el (snippet-exit-hooks): New test.,
Noam Postavsky <=
- [elpa] master 4ee3835 08/63: Use expand-env for all snippet evaluations, Noam Postavsky, 2017/07/17
- [elpa] master 203df22 22/63: Use debug-on-error to simplify error handling, Noam Postavsky, 2017/07/17
- [elpa] master 9c9547a 21/63: Don't catch and rethrow yas-{-}exception, Noam Postavsky, 2017/07/17
- [elpa] master e878afb 12/63: Update handling of markers during indentation, Noam Postavsky, 2017/07/17
- [elpa] master 6c4fbb2 24/63: Fix snippet local exit hook, Noam Postavsky, 2017/07/17
- [elpa] master d0c6fec 16/63: Refactor snippet marker manipulating functions, Noam Postavsky, 2017/07/17
- [elpa] master e74f00e 18/63: Fix whitespace lossage between mirrors, Noam Postavsky, 2017/07/17
- [elpa] master 4f37afd 27/63: Let snippets expand in strings/comments by default, Noam Postavsky, 2017/07/17
- [elpa] master cddb826 29/63: Merge: let snippets expand in strings/comments by default, Noam Postavsky, 2017/07/17
- [elpa] master 462f566 44/63: Don't leave unreadable objects in the undo list, Noam Postavsky, 2017/07/17