mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-10-13 13:13:03 +00:00
Fix: tests also use YAS--WITH-TEMPORARY-REDEFINITIONS to make stubs
This commit is contained in:
parent
1ef0091de1
commit
e5c41c78d2
@ -260,11 +260,12 @@ TODO: correct this bug!"
|
|||||||
(defmacro yas-with-overriden-buffer-list (&rest body)
|
(defmacro yas-with-overriden-buffer-list (&rest body)
|
||||||
(let ((saved-sym (gensym)))
|
(let ((saved-sym (gensym)))
|
||||||
`(let ((,saved-sym (symbol-function 'buffer-list)))
|
`(let ((,saved-sym (symbol-function 'buffer-list)))
|
||||||
(cl-flet ((buffer-list ()
|
(yas--with-temporary-redefinitions
|
||||||
(remove-if #'(lambda (buf)
|
((buffer-list ()
|
||||||
(with-current-buffer buf
|
(remove-if #'(lambda (buf)
|
||||||
(eq major-mode 'lisp-interaction-mode)))
|
(with-current-buffer buf
|
||||||
(funcall ,saved-sym))))
|
(eq major-mode 'lisp-interaction-mode)))
|
||||||
|
(funcall ,saved-sym))))
|
||||||
,@body))))
|
,@body))))
|
||||||
|
|
||||||
(defmacro yas-with-some-interesting-snippet-dirs (&rest body)
|
(defmacro yas-with-some-interesting-snippet-dirs (&rest body)
|
||||||
@ -474,9 +475,10 @@ TODO: be meaner"
|
|||||||
(defun yas/ert ()
|
(defun yas/ert ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(with-temp-buffer
|
(with-temp-buffer
|
||||||
(cl-flet ((message (&rest args) ;
|
(yas--with-temporary-redefinitions
|
||||||
(declare (ignore args))
|
((message (&rest args) ;
|
||||||
nil))
|
(declare (ignore args))
|
||||||
|
nil))
|
||||||
(ert t (buffer-name (current-buffer)))
|
(ert t (buffer-name (current-buffer)))
|
||||||
(princ (buffer-string)))))
|
(princ (buffer-string)))))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user