aboutsummaryrefslogtreecommitdiff
path: root/test/projectile-legacy-test.el
diff options
context:
space:
mode:
Diffstat (limited to 'test/projectile-legacy-test.el')
-rw-r--r--test/projectile-legacy-test.el121
1 files changed, 0 insertions, 121 deletions
diff --git a/test/projectile-legacy-test.el b/test/projectile-legacy-test.el
index bebbcb0..635ab85 100644
--- a/test/projectile-legacy-test.el
+++ b/test/projectile-legacy-test.el
@@ -448,127 +448,6 @@
(projectile-file-exists-cache-cleanup)
(should-not projectile-file-exists-cache-timer)))))))
-(ert-deftest projectile-test-cache-current-file ()
- (projectile-test-with-sandbox
- (projectile-test-with-files
- ("project/"
- "project/.projectile"
- "project/file1.el"
- "project/file2.el"
- "project/file3.el"
- "project/file4.el")
- (cd "project")
- (let ((projectile-projects-cache (make-hash-table :test #'equal))
- (projectile-projects-cache-time (make-hash-table :test #'equal))
- (projectile-enable-caching t))
- (puthash (projectile-project-root)
- '("file1.el")
- projectile-projects-cache)
- (noflet ((projectile-project-root () (file-truename default-directory))
- (projectile-project-vcs (project) 'none))
- (with-current-buffer (find-file-noselect "file2.el" t)
- (projectile-cache-current-file)
- (dolist (f '("file1.el" "file2.el"))
- (should (member f (gethash (projectile-project-root)
- projectile-projects-cache)))))
- (with-current-buffer (find-file-noselect "file3.el" t)
- (projectile-cache-current-file)
- (dolist (f '("file1.el" "file2.el" "file3.el"))
- (should (member f (gethash (projectile-project-root)
- projectile-projects-cache)))))
- (with-current-buffer (find-file-noselect "file4.el" t)
- (projectile-cache-current-file)
- (dolist (f '("file1.el" "file2.el" "file3.el" "file4.el"))
- (should (member f (gethash (projectile-project-root)
- projectile-projects-cache))))))))))
-
-(ert-deftest projectile-test-cache-expiring ()
- "Ensure that we update the cache if it's expired."
- (projectile-test-with-sandbox
- (projectile-test-with-files
- ("project/"
- "project/.projectile"
- "project/file1.el"
- "project/file2.el")
- (cd "project")
- (let ((projectile-projects-cache (make-hash-table :test #'equal))
- (projectile-projects-cache-time (make-hash-table :test #'equal))
- (projectile-enable-caching t)
- (projectile-files-cache-expire 10))
- ;; Create a stale cache with only one file in it.
- (puthash (projectile-project-root)
- '("file1.el")
- projectile-projects-cache)
- (puthash (projectile-project-root)
- 0 ;; Cached 1st of January 1970.
- projectile-projects-cache-time)
-
- (noflet ((projectile-project-root () (file-truename default-directory))
- (projectile-project-vcs (project) 'none))
- ;; After listing all the files, the cache should have been updated.
- (projectile-current-project-files)
- ;; find returns the leading ./ therefore the somewhat odd notation here
- (dolist (f '("./file1.el" "./file2.el"))
- (should (member f (gethash (projectile-project-root)
- projectile-projects-cache)))))))))
-
-(ert-deftest projectile-test-old-project-root-gone ()
- "Ensure that we don't cache a project root if the path has changed."
- (projectile-test-with-sandbox
- (projectile-test-with-files
- ("project/"
- "project/.projectile")
- (cd "project")
- (let* ((projectile-project-root-cache (make-hash-table :test #'equal))
- (correct-project-root (projectile-project-root)))
- ;; If this project has been moved, then we will have stale
- ;; paths in the cache.
- (puthash
- (format "projectile-root-bottom-up-%s" correct-project-root)
- "/this/path/does/not/exist"
- projectile-project-root-cache)
- (should (string= (projectile-project-root) correct-project-root))))))
-
-(ert-deftest projectile-test-git-grep-prefix ()
- (require 'vc-git)
- (projectile-test-with-sandbox
- (projectile-test-with-files
- ("project/c/src/"
- "project/c/include/"
- "project/go/src/package1/"
- "project/.projectile")
- (cd "project")
- (with-temp-file "go/src/package1/x.go" (insert "foo(bar)"))
- (with-temp-file "c/include/x.h" (insert "typedef struct bar_t" ))
- (with-temp-file "c/src/x.c" (insert "struct bar_t *x"))
- (dolist (test '(("go/src/package1/x.go" "foo" "*.go")
- ("c/src/x.c" "bar_t" "*.[ch]")
- ("c/include/x.h" "bar_t" "*.[ch]")))
- (let ((projectile-use-git-grep t)
- (current-prefix-arg '-)
- (sym (cadr test)))
- (noflet ((projectile-project-vcs () 'git)
- (read-string (prompt initial-input history default-value &rest args)
- (if (should (equal sym default-value)) default-value))
- (vc-git-grep (regexp files dir)
- (progn (should (equal sym regexp))
- (should (equal (car (last test)) files))
- (should (equal (projectile-project-root) dir)))))
- (with-current-buffer (find-file-noselect (car test) t)
- (save-excursion
- (re-search-forward sym)
- (projectile-grep nil ?-)))))))))
-
-(ert-deftest projectile-switch-project-no-projects ()
- (let ((projectile-known-projects nil))
- (should-error (projectile-switch-project))))
-
-(ert-deftest projectile-ignored-buffer-p-by-name ()
- (let ((projectile-globally-ignored-buffers '("*nrepl messages*" "*something*")))
- (should (projectile-ignored-buffer-p (get-buffer-create "*nrepl messages*")))
- (should (projectile-ignored-buffer-p (get-buffer-create "*something*")))
- (should-not (projectile-ignored-buffer-p (get-buffer-create "test")))))
-
(defun projectile-test-tmp-file-path ()
"Return a filename suitable to save data to in the
test temp directory"