1 ;;; yasnippet-tests.el --- some yasnippet tests
3 ;; Copyright (C) 2012 João Távora
5 ;; Author: João Távora <joaot@siscog.pt>
6 ;; Keywords: emulations, convenience
8 ;; This program is free software; you can redistribute it and/or modify
9 ;; it under the terms of the GNU General Public License as published by
10 ;; the Free Software Foundation, either version 3 of the License, or
11 ;; (at your option) any later version.
13 ;; This program is distributed in the hope that it will be useful,
14 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;; GNU General Public License for more details.
18 ;; You should have received a copy of the GNU General Public License
19 ;; along with this program. If not, see <http://www.gnu.org/licenses/>.
23 ;; Test basic snippet mechanics and the loading system
34 (defun yas--buffer-contents ()
35 (buffer-substring-no-properties (point-min) (point-max)))
37 (ert-deftest field-navigation ()
40 (yas-expand-snippet "${1:brother} from another ${2:mother}")
41 (should (string= (yas--buffer-contents)
42 "brother from another mother"))
44 (should (looking-at "brother"))
45 (ert-simulate-command '(yas-next-field-or-maybe-expand))
46 (should (looking-at "mother"))
47 (ert-simulate-command '(yas-prev-field))
48 (should (looking-at "brother"))))
50 (ert-deftest simple-mirror ()
53 (yas-expand-snippet "${1:brother} from another $1")
54 (should (string= (yas--buffer-contents)
55 "brother from another brother"))
56 (ert-simulate-command `(yas-mock-insert "bla"))
57 (should (string= (yas--buffer-contents)
58 "bla from another bla"))))
60 (ert-deftest mirror-with-transformation ()
63 (yas-expand-snippet "${1:brother} from another ${1:$(upcase yas-text)}")
64 (should (string= (yas--buffer-contents)
65 "brother from another BROTHER"))
66 (ert-simulate-command `(yas-mock-insert "bla"))
67 (should (string= (yas--buffer-contents)
68 "bla from another BLA"))))
70 (ert-deftest primary-field-transformation ()
73 (let ((snippet "${1:$$(upcase yas-text)}${1:$(concat \"bar\" yas-text)}"))
74 (yas-expand-snippet snippet)
75 (should (string= (yas--buffer-contents) "bar"))
76 (ert-simulate-command `(yas-mock-insert "foo"))
77 (should (string= (yas--buffer-contents) "FOObarFOO")))))
79 (ert-deftest nested-placeholders-kill-superfield ()
82 (yas-expand-snippet "brother from ${2:another ${3:mother}}!")
83 (should (string= (yas--buffer-contents)
84 "brother from another mother!"))
85 (ert-simulate-command `(yas-mock-insert "bla"))
86 (should (string= (yas--buffer-contents)
87 "brother from bla!"))))
89 (ert-deftest nested-placeholders-use-subfield ()
92 (yas-expand-snippet "brother from ${2:another ${3:mother}}!")
93 (ert-simulate-command '(yas-next-field-or-maybe-expand))
94 (ert-simulate-command `(yas-mock-insert "bla"))
95 (should (string= (yas--buffer-contents)
96 "brother from another bla!"))))
98 (ert-deftest mirrors-adjacent-to-fields-with-nested-mirrors ()
101 (yas-expand-snippet "<%= f.submit \"${1:Submit}\"${2:$(and (yas-text) \", :disable_with => '\")}${2:$1ing...}${2:$(and (yas-text) \"'\")} %>")
102 (should (string= (yas--buffer-contents)
103 "<%= f.submit \"Submit\", :disable_with => 'Submiting...' %>"))
104 (ert-simulate-command `(yas-mock-insert "Send"))
105 (should (string= (yas--buffer-contents)
106 "<%= f.submit \"Send\", :disable_with => 'Sending...' %>"))))
108 (ert-deftest deep-nested-mirroring-issue-351 ()
111 (yas-expand-snippet "${1:FOOOOOOO}${2:$1}${3:$2}${4:$3}")
112 (ert-simulate-command `(yas-mock-insert "abc"))
113 (should (string= (yas--buffer-contents) "abcabcabcabc"))))
115 ;; (ert-deftest in-snippet-undo ()
117 ;; (yas-minor-mode 1)
118 ;; (yas-expand-snippet "brother from ${2:another ${3:mother}}!")
119 ;; (ert-simulate-command '(yas-next-field-or-maybe-expand))
120 ;; (ert-simulate-command `(yas-mock-insert "bla"))
121 ;; (ert-simulate-command '(undo))
122 ;; (should (string= (yas--buffer-contents)
123 ;; "brother from another mother!"))))
126 ;;; Snippet expansion and character escaping
127 ;;; Thanks to @zw963 (Billy) for the testing
129 (ert-deftest escape-dollar ()
132 (yas-expand-snippet "bla\\${1:bla}ble")
133 (should (string= (yas--buffer-contents) "bla${1:bla}ble"))))
135 (ert-deftest escape-closing-brace ()
138 (yas-expand-snippet "bla${1:bla\\}}ble")
139 (should (string= (yas--buffer-contents) "blabla}ble"))
140 (should (string= (yas-field-value 1) "bla}"))))
142 (ert-deftest escape-backslashes ()
145 (yas-expand-snippet "bla\\ble")
146 (should (string= (yas--buffer-contents) "bla\\ble"))))
148 (ert-deftest escape-backquotes ()
151 (yas-expand-snippet "bla`(upcase \"foo\\`bar\")`ble")
152 (should (string= (yas--buffer-contents) "blaFOO`BARble"))))
154 (ert-deftest escape-some-elisp-with-strings ()
155 "elisp with strings and unbalance parens inside it"
158 ;; The rules here is: to output a literal `"' you need to escape
159 ;; it with one backslash. You don't need to escape them in
161 (yas-expand-snippet "soon \\\"`(concat (upcase \"(my arms\")\"\\\" were all around her\")`")
162 (should (string= (yas--buffer-contents) "soon \"(MY ARMS\" were all around her"))))
164 (ert-deftest escape-some-elisp-with-backslashes ()
167 ;; And the rule here is: to output a literal `\' inside a string
168 ;; inside embedded elisp you need a total of six `\'
169 (yas-expand-snippet "bla`(upcase \"hey\\\\\\yo\")`ble")
170 (should (string= (yas--buffer-contents) "blaHEY\\YOble"))))
172 (ert-deftest be-careful-when-escaping-in-yas-selected-text ()
175 (let ((yas-selected-text "He\\\\o world!"))
176 (yas-expand-snippet "Look ma! `(yas-selected-text)`")
177 (should (string= (yas--buffer-contents) "Look ma! He\\\\o world!")))
178 (yas-exit-all-snippets)
180 (let ((yas-selected-text "He\"o world!"))
181 (yas-expand-snippet "Look ma! `(yas-selected-text)`")
182 (should (string= (yas--buffer-contents) "Look ma! He\"o world!")))
183 (yas-exit-all-snippets)
185 (let ((yas-selected-text "He\"\)\\o world!"))
186 (yas-expand-snippet "Look ma! `(yas-selected-text)`")
187 (should (string= (yas--buffer-contents) "Look ma! He\"\)\\o world!")))
188 (yas-exit-all-snippets)
191 (ert-deftest be-careful-when-escaping-in-yas-selected-text-2 ()
193 (let ((yas-selected-text "He)}o world!"))
194 (yas-expand-snippet "Look ma! ${1:`(yas-selected-text)`} OK?")
195 (should (string= (yas--buffer-contents) "Look ma! He)}o world! OK?")))))
197 (ert-deftest example-for-issue-271 ()
200 (let ((yas-selected-text "aaa")
201 (snippet "if ${1:condition}\n`yas-selected-text`\nelse\n$3\nend"))
202 (yas-expand-snippet snippet)
204 (ert-simulate-command `(yas-mock-insert "bbb"))
205 (should (string= (yas--buffer-contents) "if condition\naaa\nelse\nbbb\nend")))))
207 (ert-deftest example-for-issue-404 ()
211 (insert "#include <foo>\n")
212 (let ((snippet "main"))
213 (yas-expand-snippet snippet)
214 (should (string= (yas--buffer-contents) "#include <foo>\nmain")))))
216 (ert-deftest middle-of-buffer-snippet-insertion ()
220 (save-excursion (insert "end"))
221 (let ((snippet "-middle-"))
222 (yas-expand-snippet snippet))
223 (should (string= (yas--buffer-contents) "beginning-middle-end"))))
225 (ert-deftest another-example-for-issue-271 ()
226 ;; expect this to fail in batch mode since `region-active-p' doesn't
227 ;; used by `yas-expand-snippet' doesn't make sense in that context.
229 :expected-result (if noninteractive
234 (let ((snippet "\\${${1:1}:`yas-selected-text`}"))
238 (yas-expand-snippet snippet)
239 (should (string= (yas--buffer-contents) "aaa${1:bbb}ccc")))))
241 (ert-deftest string-match-with-subregexp-in-embedded-elisp ()
244 ;; the rule here is: To use regexps in embedded `(elisp)` expressions, write
245 ;; it like you would normal elisp, i.e. no need to escape the backslashes.
246 (let ((snippet "`(if (string-match \"foo\\\\(ba+r\\\\)foo\" \"foobaaaaaaaaaarfoo\")
249 (yas-expand-snippet snippet))
250 (should (string= (yas--buffer-contents) "ok"))))
252 (ert-deftest string-match-with-subregexp-in-mirror-transformations ()
255 ;; the rule here is: To use regexps in embedded `(elisp)` expressions,
256 ;; escape backslashes once, i.e. to use \\( \\) constructs, write \\\\( \\\\).
257 (let ((snippet "$1${1:$(if (string-match \"foo\\\\\\\\(ba+r\\\\\\\\)baz\" yas-text)
260 (yas-expand-snippet snippet)
261 (should (string= (yas--buffer-contents) "fail"))
262 (ert-simulate-command `(yas-mock-insert "foobaaar"))
263 (should (string= (yas--buffer-contents) "foobaaarfail"))
264 (ert-simulate-command `(yas-mock-insert "baz"))
265 (should (string= (yas--buffer-contents) "foobaaarbazok")))))
270 (ert-deftest protection-overlay-no-cheating ()
271 "Protection overlays at the very end of the buffer are dealt
272 with by cheatingly inserting a newline!
274 TODO: correct this bug!"
275 :expected-result :failed
278 (yas-expand-snippet "${2:brother} from another ${1:mother}")
279 (should (string= (yas--buffer-contents)
280 "brother from another mother") ;; no newline should be here!
285 (defun yas--call-with-temporary-redefinitions (function
286 &rest function-names-and-overriding-functions)
287 (let* ((overrides (remove-if-not #'(lambda (fdef)
288 (fboundp (first fdef)))
289 function-names-and-overriding-functions))
290 (definition-names (mapcar #'first overrides))
291 (overriding-functions (mapcar #'second overrides))
292 (saved-functions (mapcar #'symbol-function definition-names)))
293 ;; saving all definitions before overriding anything ensures FDEFINITION
294 ;; errors don't cause accidental permanent redefinitions.
296 (cl-flet ((set-fdefinitions (names functions)
297 (loop for name in names
300 (set-fdefinitions definition-names overriding-functions)
301 (unwind-protect (funcall function)
302 (set-fdefinitions definition-names saved-functions)))))
304 (defmacro yas--with-temporary-redefinitions (fdefinitions &rest body)
305 ;; "Temporarily (but globally) redefine each function in FDEFINITIONS.
306 ;; E.g.: (yas--with-temporary-redefinitions ((foo (x) ...)
308 ;; ;; code that eventually calls foo, bar of (setf foo)
310 ;; FIXME: This is hideous! Better use defadvice (or at least letf).
311 `(yas--call-with-temporary-redefinitions
313 ,@(mapcar #'(lambda (thingy)
314 `(list ',(first thingy)
315 (lambda ,@(rest thingy))))
318 (defmacro yas-with-overriden-buffer-list (&rest body)
319 (let ((saved-sym (make-symbol "yas--buffer-list")))
320 `(let ((,saved-sym (symbol-function 'buffer-list)))
321 (yas--with-temporary-redefinitions
323 (remove-if #'(lambda (buf)
324 (with-current-buffer buf
325 (eq major-mode 'lisp-interaction-mode)))
326 (funcall ,saved-sym))))
330 (defmacro yas-with-some-interesting-snippet-dirs (&rest body)
331 `(yas-saving-variables
332 (yas-with-overriden-buffer-list
333 (yas-with-snippet-dirs
334 '((".emacs.d/snippets"
336 (".yas-parents" . "cc-mode")
337 ("printf" . "printf($1);")) ;; notice the overriding for issue #281
338 ("emacs-lisp-mode" ("ert-deftest" . "(ert-deftest ${1:name} () $0)"))
339 ("lisp-interaction-mode" (".yas-parents" . "emacs-lisp-mode")))
342 (".yas-parents" . "c++-mode")
343 ("printf" . "printf"))
344 ("cc-mode" ("def" . "# define"))
345 ("emacs-lisp-mode" ("dolist" . "(dolist)"))
346 ("lisp-interaction-mode" ("sc" . "brother from another mother"))))
350 (ert-deftest basic-jit-loading ()
351 "Test basic loading and expansion of snippets"
352 (yas-with-some-interesting-snippet-dirs
354 (yas--basic-jit-loading-1)))
356 (ert-deftest basic-jit-loading-with-compiled-snippets ()
357 "Test basic loading and expansion of snippets"
358 (yas-with-some-interesting-snippet-dirs
361 (yas--with-temporary-redefinitions ((yas--load-directory-2
363 (ert-fail "yas--load-directory-2 shouldn't be called when snippets have been compiled")))
365 (yas--basic-jit-loading-1))))
367 (ert-deftest loading-with-cyclic-parenthood ()
368 "Test loading when cyclic parenthood is setup."
369 (yas-saving-variables
370 (yas-with-snippet-dirs '((".emacs.d/snippets"
372 (".yas-parents" . "cc-mode"))
374 (".yas-parents" . "yet-another-c-mode and-that-one"))
375 ("yet-another-c-mode"
376 (".yas-parents" . "c-mode and-also-this-one lisp-interaction-mode"))))
379 (let* ((major-mode 'c-mode)
387 lisp-interaction-mode))
388 (observed (yas--modes-to-activate)))
389 (should (null (cl-set-exclusive-or expected observed)))
390 (should (= (length expected)
391 (length observed))))))))
393 (defun yas--basic-jit-loading-1 ()
395 (should (= 4 (hash-table-count yas--scheduled-jit-loads)))
396 (should (= 0 (hash-table-count yas--tables)))
397 (lisp-interaction-mode)
399 (should (= 2 (hash-table-count yas--scheduled-jit-loads)))
400 (should (= 2 (hash-table-count yas--tables)))
401 (should (= 1 (hash-table-count (yas--table-uuidhash (gethash 'lisp-interaction-mode yas--tables)))))
402 (should (= 2 (hash-table-count (yas--table-uuidhash (gethash 'emacs-lisp-mode yas--tables)))))
403 (yas-should-expand '(("sc" . "brother from another mother")
404 ("dolist" . "(dolist)")
405 ("ert-deftest" . "(ert-deftest name () )")))
408 (should (= 0 (hash-table-count yas--scheduled-jit-loads)))
409 (should (= 4 (hash-table-count yas--tables)))
410 (should (= 1 (hash-table-count (yas--table-uuidhash (gethash 'c-mode yas--tables)))))
411 (should (= 1 (hash-table-count (yas--table-uuidhash (gethash 'cc-mode yas--tables)))))
412 (yas-should-expand '(("printf" . "printf();")
413 ("def" . "# define")))
414 (yas-should-not-expand '("sc" "dolist" "ert-deftest"))))
419 (defmacro yas-with-even-more-interesting-snippet-dirs (&rest body)
420 `(yas-saving-variables
421 (yas-with-snippet-dirs
422 `((".emacs.d/snippets"
424 (".yas-make-groups" . "")
425 ("printf" . "printf($1);")
427 ("fnprintf" . "fprintf($1);")
428 ("snprintf" . "snprintf($1);"))
430 ("strcmp" . "strecmp($1);")
431 ("strcasecmp" . "strcasecmp($1);")))
432 ("lisp-interaction-mode"
433 ("ert-deftest" . "# group: barbar\n# --\n(ert-deftest ${1:name} () $0)"))
435 ("a-guy" . "# uuid: 999\n# --\nyo!")
436 ("a-sir" . "# uuid: 12345\n# --\nindeed!")
437 ("a-lady" . "# uuid: 54321\n# --\noh-la-la!")
438 ("a-beggar" . "# uuid: 0101\n# --\narrrgh!")
439 ("an-outcast" . "# uuid: 666\n# --\narrrgh!")
440 (".yas-setup.el" . , (pp-to-string
441 '(yas-define-menu 'fancy-mode
442 '((yas-ignore-item "0101")
445 ((yas-item "12345")))
446 (yas-submenu "ladies"
447 ((yas-item "54321"))))
451 (ert-deftest test-yas-define-menu ()
452 (let ((yas-use-menu t))
453 (yas-with-even-more-interesting-snippet-dirs
454 (yas-reload-all 'no-jit)
455 (let ((menu (cdr (gethash 'fancy-mode yas--menu-table))))
456 (should (eql 4 (length menu)))
457 (dolist (item '("a-guy" "a-beggar"))
458 (should (find item menu :key #'third :test #'string=)))
459 (should-not (find "an-outcast" menu :key #'third :test #'string=))
460 (dolist (submenu '("sirs" "ladies"))
463 (find submenu menu :key #'third :test #'string=)))))
466 (ert-deftest test-group-menus ()
467 "Test group-based menus using .yas-make-groups and the group directive"
468 (let ((yas-use-menu t))
469 (yas-with-even-more-interesting-snippet-dirs
470 (yas-reload-all 'no-jit)
471 ;; first the subdir-based groups
473 (let ((menu (cdr (gethash 'c-mode yas--menu-table))))
474 (should (eql 3 (length menu)))
475 (dolist (item '("printf" "foo-group-a" "foo-group-b"))
476 (should (find item menu :key #'third :test #'string=)))
477 (dolist (submenu '("foo-group-a" "foo-group-b"))
480 (find submenu menu :key #'third :test #'string=))))))
481 ;; now group directives
483 (let ((menu (cdr (gethash 'lisp-interaction-mode yas--menu-table))))
484 (should (eql 1 (length menu)))
485 (should (find "barbar" menu :key #'third :test #'string=))
488 (find "barbar" menu :key #'third :test #'string=))))))))
490 (ert-deftest test-group-menus-twisted ()
491 "Same as similarly named test, but be mean.
494 (let ((yas-use-menu t))
495 (yas-with-even-more-interesting-snippet-dirs
496 ;; add a group directive conflicting with the subdir and watch
499 (insert "# group: foo-group-c\n# --\nstrecmp($1)")
500 (write-region nil nil (concat (first (yas-snippet-dirs))
501 "/c-mode/foo-group-b/strcmp")))
502 (yas-reload-all 'no-jit)
503 (let ((menu (cdr (gethash 'c-mode yas--menu-table))))
504 (should (eql 4 (length menu)))
505 (dolist (item '("printf" "foo-group-a" "foo-group-b" "foo-group-c"))
506 (should (find item menu :key #'third :test #'string=)))
507 (dolist (submenu '("foo-group-a" "foo-group-b" "foo-group-c"))
510 (find submenu menu :key #'third :test #'string=))))))
511 ;; delete the .yas-make-groups file and watch behaviour
513 (delete-file (concat (first (yas-snippet-dirs))
514 "/c-mode/.yas-make-groups"))
515 (yas-reload-all 'no-jit)
516 (let ((menu (cdr (gethash 'c-mode yas--menu-table))))
517 (should (eql 5 (length menu))))
518 ;; Change a group directive and reload
520 (let ((menu (cdr (gethash 'lisp-interaction-mode yas--menu-table))))
521 (should (find "barbar" menu :key #'third :test #'string=)))
524 (insert "# group: foofoo\n# --\n(ert-deftest ${1:name} () $0)")
525 (write-region nil nil (concat (first (yas-snippet-dirs))
526 "/lisp-interaction-mode/ert-deftest")))
527 (yas-reload-all 'no-jit)
528 (let ((menu (cdr (gethash 'lisp-interaction-mode yas--menu-table))))
529 (should (eql 1 (length menu)))
530 (should (find "foofoo" menu :key #'third :test #'string=))
533 (find "foofoo" menu :key #'third :test #'string=))))))))
536 ;;; The infamous and problematic tab keybinding
538 (ert-deftest test-yas-tab-binding ()
541 (should (not (eq (key-binding (yas--read-keybinding "<tab>")) 'yas-expand)))
543 (should (eq (key-binding (yas--read-keybinding "<tab>")) 'yas-expand))
544 (yas-expand-snippet "$1 $2 $3")
545 (should (eq (key-binding [(tab)]) 'yas-next-field-or-maybe-expand))
546 (should (eq (key-binding (kbd "TAB")) 'yas-next-field-or-maybe-expand))
547 (should (eq (key-binding [(shift tab)]) 'yas-prev-field))
548 (should (eq (key-binding [backtab]) 'yas-prev-field))))
550 (ert-deftest test-rebindings ()
553 (define-key yas-minor-mode-map [tab] nil)
554 (define-key yas-minor-mode-map (kbd "TAB") nil)
555 (define-key yas-minor-mode-map (kbd "SPC") 'yas-expand)
558 (should (not (eq (key-binding (yas--read-keybinding "TAB")) 'yas-expand)))
559 (should (eq (key-binding (yas--read-keybinding "SPC")) 'yas-expand))
561 (should (not (eq (key-binding (yas--read-keybinding "TAB")) 'yas-expand)))
562 (should (eq (key-binding (yas--read-keybinding "SPC")) 'yas-expand))))
563 (setcdr yas-minor-mode-map (cdr (yas--init-minor-keymap)))))
565 (ert-deftest test-yas-in-org ()
569 (should (eq (key-binding [(tab)]) 'yas-expand))
570 (should (eq (key-binding (kbd "TAB")) 'yas-expand))))
575 (defun yas-batch-run-tests ()
578 (yas--with-temporary-redefinitions
579 ((message (&rest _args) nil))
580 (ert t (buffer-name (current-buffer)))
581 (princ (buffer-string)))))
584 (defun yas-should-expand (keys-and-expansions)
585 (dolist (key-and-expansion keys-and-expansions)
586 (yas-exit-all-snippets)
588 (insert (car key-and-expansion))
589 (let ((yas-fallback-behavior nil))
590 (ert-simulate-command '(yas-expand)))
591 (should (string= (yas--buffer-contents) (cdr key-and-expansion))))
592 (yas-exit-all-snippets))
594 (defun yas-should-not-expand (keys)
596 (yas-exit-all-snippets)
599 (let ((yas-fallback-behavior nil))
600 (ert-simulate-command '(yas-expand)))
601 (should (string= (yas--buffer-contents) key))))
603 (defun yas-mock-insert (string)
606 ((= i (length string)))
607 (insert (aref string i))))
609 (defun yas-make-file-or-dirs (ass)
610 (let ((file-or-dir-name (car ass))
612 (cond ((listp content)
613 (make-directory file-or-dir-name 'parents)
614 (let ((default-directory (concat default-directory "/" file-or-dir-name)))
615 (mapc #'yas-make-file-or-dirs content)))
619 (write-region nil nil file-or-dir-name nil 'nomessage)))
621 (message "[yas] oops don't know this content")))))
624 (defun yas-variables ()
626 (mapatoms #'(lambda (sym)
627 (if (and (string-match "^yas-[^/]" (symbol-name sym))
632 (defun yas-call-with-saving-variables (fn)
633 (let* ((vars (yas-variables))
634 (saved-values (mapcar #'symbol-value vars)))
637 (loop for var in vars
638 for saved in saved-values
639 do (set var saved)))))
641 (defmacro yas-saving-variables (&rest body)
642 `(yas-call-with-saving-variables #'(lambda () ,@body)))
645 (defun yas-call-with-snippet-dirs (dirs fn)
646 (let* ((default-directory (make-temp-file "yasnippet-fixture" t))
647 (yas-snippet-dirs (mapcar #'car dirs)))
648 (with-temp-message ""
651 (mapc #'yas-make-file-or-dirs dirs)
653 (when (>= emacs-major-version 24)
654 (delete-directory default-directory 'recursive))))))
656 (defmacro yas-with-snippet-dirs (dirs &rest body)
657 (declare (indent defun))
658 `(yas-call-with-snippet-dirs ,dirs
664 (unless (fboundp 'special-mode)
665 ;; FIXME: Why provide this default definition here?!?
666 (defalias 'special-mode 'fundamental))
668 ;;; btw to test this in emacs22 mac osx:
669 ;;; curl -L -O https://github.com/mirrors/emacs/raw/master/lisp/emacs-lisp/ert.el
670 ;;; curl -L -O https://github.com/mirrors/emacs/raw/master/lisp/emacs-lisp/ert-x.el
671 ;;; /usr/bin/emacs -nw -Q -L . -l yasnippet-tests.el --batch -e ert
674 (put 'yas-saving-variables 'edebug-form-spec t)
675 (put 'yas-with-snippet-dirs 'edebug-form-spec t)
676 (put 'yas-with-overriden-buffer-list 'edebug-form-spec t)
677 (put 'yas-with-some-interesting-snippet-dirs 'edebug-form-spec t)
680 (put 'yas--with-temporary-redefinitions 'lisp-indent-function 1)
681 (put 'yas--with-temporary-redefinitions 'edebug-form-spec '((&rest (defun*)) cl-declarations body))
686 (provide 'yasnippet-tests)
687 ;;; yasnippet-tests.el ends here
689 ;; lexical-binding: t
690 ;; byte-compile-warnings: (not cl-functions)