diff options
| author | Tino Calancha | 2017-07-31 21:51:12 +0900 |
|---|---|---|
| committer | Tino Calancha | 2017-07-31 21:59:47 +0900 |
| commit | 192342a3a93a2e467ab589ae2d1ffd5e7acf1398 (patch) | |
| tree | 3824efc7ed1bb3054e472319ffffd88081e8e680 | |
| parent | 3d58ea1c0ba821a4d6915d6beeaa1617d4ad606f (diff) | |
| download | emacs-192342a3a93a2e467ab589ae2d1ffd5e7acf1398.tar.gz emacs-192342a3a93a2e467ab589ae2d1ffd5e7acf1398.zip | |
dired-tests: Unload tested features after test them
Some tests are for Dired with ls-lisp or eshell-ls.
Requiring these features add an advice on `dired' and
might affect other tests.
Do not require these features at the top of the file; require
then inside the tests and unload then at the end.
* test/lisp/dired-tests.el (dired-test-bug27693)
(dired-test-bug7131, dired-test-bug27817, dired-test-bug27631):
require ls-lisp and/or eshell-ls inside the test; unload the
features at the end.
| -rw-r--r-- | test/lisp/dired-tests.el | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/test/lisp/dired-tests.el b/test/lisp/dired-tests.el index cd58edaa3f8..d6fe839708d 100644 --- a/test/lisp/dired-tests.el +++ b/test/lisp/dired-tests.el | |||
| @@ -21,7 +21,6 @@ | |||
| 21 | (require 'ert) | 21 | (require 'ert) |
| 22 | (require 'dired) | 22 | (require 'dired) |
| 23 | (require 'nadvice) | 23 | (require 'nadvice) |
| 24 | (require 'ls-lisp) | ||
| 25 | 24 | ||
| 26 | (ert-deftest dired-autoload () | 25 | (ert-deftest dired-autoload () |
| 27 | "Tests to see whether dired-x has been autoloaded" | 26 | "Tests to see whether dired-x has been autoloaded" |
| @@ -212,6 +211,7 @@ | |||
| 212 | 211 | ||
| 213 | (ert-deftest dired-test-bug27693 () | 212 | (ert-deftest dired-test-bug27693 () |
| 214 | "Test for http://debbugs.gnu.org/27693 ." | 213 | "Test for http://debbugs.gnu.org/27693 ." |
| 214 | (require 'ls-lisp) | ||
| 215 | (let ((dir (expand-file-name "lisp" source-directory)) | 215 | (let ((dir (expand-file-name "lisp" source-directory)) |
| 216 | (size "") | 216 | (size "") |
| 217 | ls-lisp-use-insert-directory-program buf) | 217 | ls-lisp-use-insert-directory-program buf) |
| @@ -223,6 +223,7 @@ | |||
| 223 | (file-attributes (dired-get-filename))))) | 223 | (file-attributes (dired-get-filename))))) |
| 224 | (search-backward-regexp size nil t) | 224 | (search-backward-regexp size nil t) |
| 225 | (should (looking-back "[[:space:]]" (1- (point))))) | 225 | (should (looking-back "[[:space:]]" (1- (point))))) |
| 226 | (unload-feature 'ls-lisp 'force) | ||
| 226 | (when (buffer-live-p buf) (kill-buffer buf))))) | 227 | (when (buffer-live-p buf) (kill-buffer buf))))) |
| 227 | 228 | ||
| 228 | (ert-deftest dired-test-bug7131 () | 229 | (ert-deftest dired-test-bug7131 () |
| @@ -244,6 +245,7 @@ | |||
| 244 | (ert-deftest dired-test-bug27762 () | 245 | (ert-deftest dired-test-bug27762 () |
| 245 | "Test for http://debbugs.gnu.org/27762 ." | 246 | "Test for http://debbugs.gnu.org/27762 ." |
| 246 | :expected-result :failed | 247 | :expected-result :failed |
| 248 | (require 'ls-lisp) | ||
| 247 | (let* ((dir source-directory) | 249 | (let* ((dir source-directory) |
| 248 | (default-directory dir) | 250 | (default-directory dir) |
| 249 | (files (mapcar (lambda (f) (concat "src/" f)) | 251 | (files (mapcar (lambda (f) (concat "src/" f)) |
| @@ -262,6 +264,7 @@ | |||
| 262 | (should (looking-at "src")) | 264 | (should (looking-at "src")) |
| 263 | (next-line) ; File names must be aligned. | 265 | (next-line) ; File names must be aligned. |
| 264 | (should (looking-at "src"))) | 266 | (should (looking-at "src"))) |
| 267 | (unload-feature 'ls-lisp 'force) | ||
| 265 | (when (buffer-live-p buf) (kill-buffer buf))))) | 268 | (when (buffer-live-p buf) (kill-buffer buf))))) |
| 266 | 269 | ||
| 267 | (ert-deftest dired-test-bug27817 () | 270 | (ert-deftest dired-test-bug27817 () |
| @@ -275,6 +278,7 @@ | |||
| 275 | (customize-set-variable 'eshell-ls-use-in-dired t) | 278 | (customize-set-variable 'eshell-ls-use-in-dired t) |
| 276 | (should (setq buf (dired source-directory)))) | 279 | (should (setq buf (dired source-directory)))) |
| 277 | (customize-set-variable 'eshell-ls-use-in-dired orig) | 280 | (customize-set-variable 'eshell-ls-use-in-dired orig) |
| 281 | (unload-feature 'em-ls 'force) | ||
| 278 | (and (buffer-live-p buf) (kill-buffer))))) | 282 | (and (buffer-live-p buf) (kill-buffer))))) |
| 279 | 283 | ||
| 280 | (ert-deftest dired-test-bug27631 () | 284 | (ert-deftest dired-test-bug27631 () |
| @@ -311,6 +315,7 @@ | |||
| 311 | (setq buf (dired (expand-file-name "dir*/*.txt" dir))) | 315 | (setq buf (dired (expand-file-name "dir*/*.txt" dir))) |
| 312 | (dired-toggle-marks) | 316 | (dired-toggle-marks) |
| 313 | (should (cdr (dired-get-marked-files))))) | 317 | (should (cdr (dired-get-marked-files))))) |
| 318 | (unload-feature 'em-ls 'force) | ||
| 314 | (delete-directory dir 'recursive) | 319 | (delete-directory dir 'recursive) |
| 315 | (when (buffer-live-p buf) (kill-buffer buf))))) | 320 | (when (buffer-live-p buf) (kill-buffer buf))))) |
| 316 | 321 | ||