[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/evil fc993435bb 2/2: Add tests for multi-jump
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/evil fc993435bb 2/2: Add tests for multi-jump |
Date: |
Fri, 12 Jul 2024 18:59:52 -0400 (EDT) |
branch: elpa/evil
commit fc993435bbb3c486bdf0666298e2204ec170880b
Author: Tom Dalziel <tom_dl@hotmail.com>
Commit: Tom Dalziel <33435574+tomdl89@users.noreply.github.com>
Add tests for multi-jump
---
evil-jumps.el | 2 +-
evil-tests.el | 27 ++++++++++++++++++++++-----
2 files changed, 23 insertions(+), 6 deletions(-)
diff --git a/evil-jumps.el b/evil-jumps.el
index f914214966..a5ad8ba3cb 100644
--- a/evil-jumps.el
+++ b/evil-jumps.el
@@ -313,7 +313,7 @@ change the current buffer."
(when previous-pos
(setf (evil-jumps-struct-previous-pos struct) nil)
(if (and
- ;; `evil-jump-backward' and 'evil-jump-forward' needs
+ ;; `evil-jump-backward' and 'evil-jump-forward' need
;; to be handled specially. When jumping backward
;; multiple times, calling `evil-set-jump' is always
;; wrong: If you jump back twice and we call
diff --git a/evil-tests.el b/evil-tests.el
index 7ccef73275..96bf2a63f5 100644
--- a/evil-tests.el
+++ b/evil-tests.el
@@ -9722,8 +9722,7 @@ parameter set."
("3\C-i") ;; even after jumping forward 3 times it can't get past the
3rd z
"z z [z] z z z z z"))
(ert-info ("Jump across files")
- (let ((temp-file "evil-test-"))
- (make-temp-file "evil-test-")
+ (let ((temp-file (make-temp-file "evil-test-")))
(unwind-protect
(evil-test-buffer
"[z] z z z z z z"
@@ -9734,9 +9733,27 @@ parameter set."
("\C-i")
"new buffe[r]")
(delete-file temp-file)
- (with-current-buffer (get-file-buffer temp-file)
- (set-buffer-modified-p nil))
- (kill-buffer (get-file-buffer temp-file)))))))
+ (let ((buf (file-name-nondirectory temp-file)))
+ (when (get-buffer buf) (kill-buffer buf))))))
+ (ert-info ("Jump multiple times between files")
+ (let ((a (make-temp-file "evil-aa-" nil nil "evil-bb\n\nthis is a"))
+ (b (make-temp-file "evil-bb-" nil nil "evil-cc\n\nthis is b"))
+ (c (make-temp-file "evil-cc-" nil nil "this is c")))
+ (unwind-protect
+ (evil-test-buffer
+ (find-file a)
+ ("gf" [return])
+ "evil-cc\n\nthis is b"
+ ("gf" [return])
+ "this is c"
+ ("\C-o" "\C-o")
+ "evil-bb\n\nthis is a"
+ ("\C-i" "\C-i")
+ "this is c")
+ (dolist (f (list a b c))
+ (let ((buf (file-name-nondirectory f)))
+ (when (get-buffer buf) (kill-buffer buf)))
+ (delete-file f)))))))
(ert-deftest evil-test-find-file ()
:tags '(evil jumps)