Extend tramp-archive-test45-auto-load

* test/lisp/net/tramp-archive-tests.el (tramp-archive-test45-auto-load):
Extend test.
This commit is contained in:
Michael Albinus 2022-04-08 13:12:26 +02:00
parent ff997ad786
commit 886339747b

View file

@ -926,28 +926,31 @@ This tests also `file-executable-p', `file-writable-p' and `set-file-modes'."
(file-attributes %S \"/\")) \ (file-attributes %S \"/\")) \
(message \"tramp-archive loaded: %%s\" \ (message \"tramp-archive loaded: %%s\" \
(featurep 'tramp-archive))))")) (featurep 'tramp-archive))))"))
(dolist (default-directory (dolist (enabled '(t nil))
`(,temporary-file-directory (dolist (default-directory
;; Starting Emacs in a directory which has `(,temporary-file-directory
;; `tramp-archive-file-name-regexp' syntax is ;; Starting Emacs in a directory which has
;; supported only with Emacs > 27.2 (sigh!). ;; `tramp-archive-file-name-regexp' syntax is
;; (Bug#48476) ;; supported only with Emacs > 27.2 (sigh!).
,(file-name-as-directory tramp-archive-test-directory))) ;; (Bug#48476)
(dolist (file `("/mock::foo" ,(concat tramp-archive-test-archive "foo"))) ,(file-name-as-directory tramp-archive-test-directory)))
(should (dolist (file `("/mock::foo" ,(concat tramp-archive-test-archive "foo")))
(string-match (should
(format (string-match
"tramp-archive loaded: %s[[:ascii:]]+tramp-archive loaded: %s" (format
(tramp-archive-file-name-p default-directory) "tramp-archive loaded: %s[[:ascii:]]+tramp-archive loaded: %s"
(or (tramp-archive-file-name-p default-directory) (tramp-archive-file-name-p default-directory)
(tramp-archive-file-name-p file))) (or (tramp-archive-file-name-p default-directory)
(shell-command-to-string (and enabled (tramp-archive-file-name-p file))))
(format (shell-command-to-string
"%s -batch -Q -L %s --eval %s" (format
(shell-quote-argument "%s -batch -Q -L %s --eval %s --eval %s"
(expand-file-name invocation-name invocation-directory)) (shell-quote-argument
(mapconcat #'shell-quote-argument load-path " -L ") (expand-file-name invocation-name invocation-directory))
(shell-quote-argument (format code file)))))))))) (mapconcat #'shell-quote-argument load-path " -L ")
(shell-quote-argument
(format "(setq tramp-archive-enabled %s)" enabled))
(shell-quote-argument (format code file)))))))))))
(ert-deftest tramp-archive-test45-delay-load () (ert-deftest tramp-archive-test45-delay-load ()
"Check that `tramp-archive' is loaded lazily, only when needed." "Check that `tramp-archive' is loaded lazily, only when needed."