aboutsummaryrefslogtreecommitdiff
path: root/evil-test-helpers.el
diff options
context:
space:
mode:
authorEvgeni Kolev <evgenysw@gmail.com>2017-07-19 12:53:13 +0300
committerEvgeni Kolev <evgenysw@gmail.com>2017-07-19 12:53:13 +0300
commitf22966893325ef01d9d6456c2b5e35acf1278e1c (patch)
tree24b79db7e7daca080d3aa8576b69ba40f473e307 /evil-test-helpers.el
parentdc936936666595afdbdbb4cc44c1f82e74c6802c (diff)
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
Diffstat (limited to 'evil-test-helpers.el')
-rw-r--r--evil-test-helpers.el30
1 files 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 <vegard_oye at hotmail.com>
;; Maintainer: Vegard Øye <vegard_oye at hotmail.com>
-
+;; 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