diff --git a/core/autoload/test.el b/core/autoload/test.el index 34427ca1a..0559d40d9 100644 --- a/core/autoload/test.el +++ b/core/autoload/test.el @@ -71,7 +71,7 @@ If neither is available, run all tests in all enabled modules." (setq plist (reverse plist)) (when-let* ((modes (doom-enlist (plist-get plist :minor-mode)))) (dolist (mode modes) - (setq body `((with-minor-mode!! ,mode ,@body))))) + (setq body `((with-minor-mode! ,mode ,@body))))) (when-let* ((before (plist-get plist :before))) (setq body `(,@before ,@body))) (when-let* ((after (plist-get plist :after))) @@ -91,7 +91,7 @@ If neither is available, run all tests in all enabled modules." (save-window-excursion ,@body))))))) -(defmacro should-buffer!! (initial expected &rest body) +(defmacro should-buffer! (initial expected &rest body) "Test that a buffer with INITIAL text, run BODY, then test it against EXPECTED. INITIAL will recognize cursor markers in the form {[0-9]}. A {0} marker marks @@ -119,7 +119,7 @@ against." (lambda (m1 m2) (< (marker-position m1) (marker-position m2)))) (when (equal (caar marker-list) "0") - (goto-char!! 0))) + (goto-char! 0))) ,@body (let ((result-text (buffer-substring-no-properties (point-min) (point-max))) (point (point)) @@ -137,27 +137,27 @@ against." (should (equal expected-text result-text)) (should same-point))))))) -(defmacro goto-char!! (index) - "Meant to be used with `should-buffer!!'. Will move the cursor to one of the -cursor markers. e.g. Go to marker {2} with (goto-char!! 2)." - `(goto-char (point!! ,index))) +(defmacro goto-char! (index) + "Meant to be used with `should-buffer!'. Will move the cursor to one of the +cursor markers. e.g. Go to marker {2} with (goto-char! 2)." + `(goto-char (point! ,index))) -(defmacro point!! (index) - "Meant to be used with `should-buffer!!'. Returns the position of a cursor -marker. e.g. {2} can be retrieved with (point!! 2)." +(defmacro point! (index) + "Meant to be used with `should-buffer!'. Returns the position of a cursor +marker. e.g. {2} can be retrieved with (point! 2)." `(cdr (assoc ,(cond ((numberp index) (number-to-string index)) ((symbolp index) (symbol-name index)) ((stringp index) index)) marker-list))) -(defmacro with-minor-mode!! (mode &rest body) +(defmacro with-minor-mode! (mode &rest body) "Activate a minor mode while in BODY, deactivating it after." (declare (indent defun)) `(progn (,mode +1) ,@body (,mode -1))) -(defmacro let-advice!! (binds &rest body) +(defmacro let-advice! (binds &rest body) "Temporarily bind advice in BINDS while in BODY. e.g. (old-fn :before advice-fn) diff --git a/modules/feature/evil/test/autoload-files.el b/modules/feature/evil/test/autoload-files.el index 48fd0905a..1dd09486c 100644 --- a/modules/feature/evil/test/autoload-files.el +++ b/modules/feature/evil/test/autoload-files.el @@ -9,7 +9,7 @@ affects your Emacs packages)." (other ,dest)) (with-temp-file it (insert "Hello world")) - (with-minor-mode!! projectile-mode + (with-minor-mode! projectile-mode (unwind-protect (progn (should (file-exists-p it)) diff --git a/modules/lang/org/test/autoload-org.el b/modules/lang/org/test/autoload-org.el index 4a7fdb48b..3c7b9a6bc 100644 --- a/modules/lang/org/test/autoload-org.el +++ b/modules/lang/org/test/autoload-org.el @@ -4,7 +4,7 @@ (require! :lang org) (defmacro should-org-buffer!! (source expected &rest body) - `(should-buffer!! ,source ,expected + `(should-buffer! ,source ,expected (org-mode) ,@body))