aboutsummaryrefslogtreecommitdiff
path: root/evil-test-helpers.el
diff options
context:
space:
mode:
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