From 4d51a1ab09075ac1ae5302d9506bcb154f9150e2 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 3 Jan 2018 19:59:15 -0500 Subject: [PATCH] Fix :skip property in def-test! --- core/autoload/test.el | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/core/autoload/test.el b/core/autoload/test.el index dd2ea3796..5e1dc8bd8 100644 --- a/core/autoload/test.el +++ b/core/autoload/test.el @@ -76,10 +76,9 @@ If neither is available, run all tests in all enabled modules." (declare (indent defun) (doc-string 2)) (let (plist) (while (keywordp (car body)) + (push (pop body) plist) (push (pop body) plist)) (setq plist (reverse plist)) - (when (plist-get plist :skip) - (setq body `((ert-skip nil) ,@body))) (when-let* ((modes (doom-enlist (plist-get plist :minor-mode)))) (dolist (mode modes) (setq body `((with-minor-mode!! ,mode ,@body))))) @@ -94,10 +93,12 @@ If neither is available, run all tests in all enabled modules." do (setq path (replace-regexp-in-string rep with path t t)) finally return (intern (format "%s::%s" path name))) () - (with-temp-buffer - (save-mark-and-excursion - (save-window-excursion - ,@body)))))) + ,(if (plist-get plist :skip) + `(ert-skip ,(plist-get plist :skip)) + `(with-temp-buffer + (save-mark-and-excursion + (save-window-excursion + ,@body))))))) (defmacro should-buffer!! (initial expected &rest body) "Test that a buffer with INITIAL text, run BODY, then test it against EXPECTED.