From f22966893325ef01d9d6456c2b5e35acf1278e1c Mon Sep 17 00:00:00 2001 From: Evgeni Kolev Date: Wed, 19 Jul 2017 12:53:13 +0300 Subject: Cleanup evil-test-helper.el - add Package-Requires header - fix byte compile warning about evil-test-selection - move call to `provide` to the bottom of the file --- evil-test-helpers.el | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/evil-test-helpers.el b/evil-test-helpers.el index 1821261..8153b2c 100644 --- a/evil-test-helpers.el +++ b/evil-test-helpers.el @@ -2,7 +2,7 @@ ;; Author: Vegard Øye ;; Maintainer: Vegard Øye - +;; Package-Requires: ((evil "1.2.12")) ;; Version: 1.2.12 ;; This file is NOT part of GNU Emacs. @@ -53,8 +53,6 @@ ;;; Code: -(provide 'evil-test-helpers) - (when (fboundp 'font-lock-add-keywords) (font-lock-add-keywords 'emacs-lisp-mode '(("(\\(evil-test-buffer\\)\\>" @@ -177,6 +175,18 @@ raised. Remaining forms are evaluated as-is. (and (buffer-name buffer) (kill-buffer buffer)))))) +(defmacro evil-test-selection (string &optional end-string + before-predicate after-predicate) + "Verify that the Visual selection contains STRING." + (declare (indent defun)) + `(progn + (save-excursion + (goto-char (or evil-visual-beginning (region-beginning))) + (evil-test-text nil (or ,string ,end-string) ,before-predicate)) + (save-excursion + (goto-char (or evil-visual-end (region-end))) + (evil-test-text (or ,end-string ,string) nil nil ,after-predicate)))) + (defun evil-test-buffer-string (string &optional point-start point-end visual-start visual-end) @@ -349,18 +359,6 @@ is executed at the end." (forward-char (length after)) (should (funcall after-predicate)))))) -(defmacro evil-test-selection (string &optional end-string - before-predicate after-predicate) - "Verify that the Visual selection contains STRING." - (declare (indent defun)) - `(progn - (save-excursion - (goto-char (or evil-visual-beginning (region-beginning))) - (evil-test-text nil (or ,string ,end-string) ,before-predicate)) - (save-excursion - (goto-char (or evil-visual-end (region-end))) - (evil-test-text (or ,end-string ,string) nil nil ,after-predicate)))) - (defmacro evil-test-region (string &optional end-string before-predicate after-predicate) "Verify that the region contains STRING." @@ -416,4 +414,6 @@ the end of the execution of BODY." (should (string= (buffer-string) contents)))) +(provide 'evil-test-helpers) + ;;; evil-test-helpers.el ends here -- cgit v1.0