branch: master
commit e9f0772e0084b4a2feb2957dd5d9ced7a12c9fb0
Author: Oleh Krehel <[email protected]>
Commit: Oleh Krehel <[email protected]>
ivy-test.el (counsel-find-file-with-dollars): Adjust
---
Makefile | 5 +----
ivy-test.el | 29 ++++++++++++++++++-----------
2 files changed, 19 insertions(+), 15 deletions(-)
diff --git a/Makefile b/Makefile
index 968b8a4..c6f3eca 100644
--- a/Makefile
+++ b/Makefile
@@ -6,10 +6,7 @@ RM ?= rm -f
all: test
-tests:
- git clone -b test --single-branch https://github.com/abo-abo/swiper/
tests
-
-test: tests
+test:
$(emacs) -batch $(LOAD) -l ivy-test.el -f ert-run-tests-batch-and-exit
checkdoc:
diff --git a/ivy-test.el b/ivy-test.el
index 8f86b89..46a72dd 100644
--- a/ivy-test.el
+++ b/ivy-test.el
@@ -1120,33 +1120,40 @@ a buffer visiting a file."
"C-p C-m")
""))))
+(defun counsel--setup-test-files ()
+ (unless (file-exists-p "tests/")
+ (shell-command
+ "git clone -b test --single-branch https://github.com/abo-abo/swiper/
tests"))
+ (let ((default-directory (expand-file-name "tests/"))
+ (version "b1a2bbf"))
+ (shell-command
+ (format "git checkout %s || git fetch && git checkout %s" version
version))))
+
(ert-deftest counsel-find-file-with-dollars ()
- ;; This should be `skip-unless' instead,
- ;; but it was only added in Emacs 24.4.
- :expected-result (if (file-exists-p "test") :passed :failed)
+ (counsel--setup-test-files)
(should (string=
(file-relative-name
(ivy-with '(counsel-find-file) "fo C-m"
- :dir "test/find-file/files-with-dollar/"))
- "test/find-file/files-with-dollar/foo$")))
+ :dir "tests/find-file/files-with-dollar/"))
+ "tests/find-file/files-with-dollar/foo$")))
(ert-deftest counsel-find-file-with-dotfiles ()
;; This should be `skip-unless' instead,
;; but it was only added in Emacs 24.4.
- :expected-result (if (and (file-exists-p "test")
- (= emacs-major-version 26))
+ :expected-result (if (= emacs-major-version 26)
:passed
:failed)
+ (counsel--setup-test-files)
(should (string=
(file-relative-name
(ivy-with '(counsel-find-file) "f C-m"
- :dir "test/find-file/dotfiles/"))
- "test/find-file/dotfiles/foo/"))
+ :dir "tests/find-file/dotfiles/"))
+ "tests/find-file/dotfiles/foo/"))
(should (string=
(file-relative-name
(ivy-with '(counsel-find-file) "foob C-m"
- :dir "test/find-file/dotfiles/"))
- "test/find-file/dotfiles/.foobar1")))
+ :dir "tests/find-file/dotfiles/"))
+ "tests/find-file/dotfiles/.foobar1")))
(provide 'ivy-test)