"Test setting connection-local profile variables."
;; Declare (PROFILE VARIABLES) objects.
- (let (connection-local-profile-alist connection-local-criteria-alist)
+ (let ((clpa connection-local-profile-alist)
+ (clca connection-local-criteria-alist)
+ connection-local-profile-alist connection-local-criteria-alist)
(connection-local-set-profile-variables
'remote-bash files-x-test--variables1)
(should
(should
(equal
(connection-local-get-profile-variables 'remote-nullfile)
- files-x-test--variables4))))
+ files-x-test--variables4))
+
+ ;; Cleanup.
+ (custom-set-variables
+ `(connection-local-profile-alist ',clpa now)
+ `(connection-local-criteria-alist ',clca now))))
(ert-deftest files-x-test-connection-local-update-profile-variables ()
"Test updating connection-local profile variables."
;; Declare (PROFILE VARIABLES) objects.
- (let (connection-local-profile-alist connection-local-criteria-alist)
+ (let ((clpa connection-local-profile-alist)
+ (clca connection-local-criteria-alist)
+ connection-local-profile-alist connection-local-criteria-alist)
(connection-local-set-profile-variables
'remote-bash (copy-alist files-x-test--variables1))
(should
(equal
(connection-local-get-profile-variables 'remote-bash)
(cons (car files-x-test--variables2)
- (cdr files-x-test--variables1))))))
+ (cdr files-x-test--variables1))))
+
+ ;; Cleanup.
+ (custom-set-variables
+ `(connection-local-profile-alist ',clpa now)
+ `(connection-local-criteria-alist ',clca now))))
(ert-deftest files-x-test-connection-local-set-profiles ()
"Test setting connection-local profiles."
;; Declare (CRITERIA PROFILES) objects.
- (let (connection-local-profile-alist connection-local-criteria-alist)
+ (let ((clpa connection-local-profile-alist)
+ (clca connection-local-criteria-alist)
+ connection-local-profile-alist connection-local-criteria-alist)
(connection-local-set-profile-variables
'remote-bash files-x-test--variables1)
(connection-local-set-profile-variables
'(remote-bash remote-ksh remote-nullfile)))
;; A criteria other than plist is wrong.
- (should-error (connection-local-set-profiles 'dummy))))
+ (should-error (connection-local-set-profiles 'dummy))
+
+ ;; Cleanup.
+ (custom-set-variables
+ `(connection-local-profile-alist ',clpa now)
+ `(connection-local-criteria-alist ',clca now))))
(ert-deftest files-x-test-hack-connection-local-variables-apply ()
"Test setting connection-local variables."
- (let (connection-local-profile-alist connection-local-criteria-alist)
+ (let ((clpa connection-local-profile-alist)
+ (clca connection-local-criteria-alist)
+ connection-local-profile-alist connection-local-criteria-alist)
(connection-local-set-profile-variables
'remote-bash files-x-test--variables1)
(hack-connection-local-variables-apply nil)
(should-not connection-local-variables-alist)
(should-not (local-variable-p 'remote-shell-file-name))
- (should-not (boundp 'remote-shell-file-name))))))
+ (should-not (boundp 'remote-shell-file-name))))
+
+ ;; Cleanup.
+ (custom-set-variables
+ `(connection-local-profile-alist ',clpa now)
+ `(connection-local-criteria-alist ',clca now))))
(ert-deftest files-x-test-with-connection-local-variables ()
"Test setting connection-local variables."
- (let ((connection-local-profile-alist connection-local-profile-alist)
- (connection-local-criteria-alist connection-local-criteria-alist))
+ (let ((clpa connection-local-profile-alist)
+ (clca connection-local-criteria-alist))
(connection-local-set-profile-variables
'remote-bash files-x-test--variables1)
(connection-local-set-profile-variables
(should-not (local-variable-p 'remote-null-device))
;; The variable values are reset.
(should-not (boundp 'remote-shell-file-name))
- (should (string-equal (symbol-value 'remote-null-device) "null"))))))
+ (should (string-equal (symbol-value 'remote-null-device) "null"))))
+
+ ;; Cleanup.
+ (custom-set-variables
+ `(connection-local-profile-alist ',clpa now)
+ `(connection-local-criteria-alist ',clca now))))
(defun files-x-test--get-lazy-var ()
"Get the connection-local value of `remote-lazy-var'.
(ert-deftest files-x-test-setq-connection-local ()
"Test dynamically setting connection local variables."
- (let (connection-local-profile-alist connection-local-criteria-alist)
+ (let ((clpa connection-local-profile-alist)
+ (clca connection-local-criteria-alist)
+ connection-local-profile-alist connection-local-criteria-alist)
(connection-local-set-profile-variables
'remote-lazy files-x-test--variables5)
(connection-local-set-profiles
(should (equal (files-x-test--get-lazy-var) "there"))
(with-connection-local-application-variables
(cadr files-x-test--application)
- (should (equal remote-null-device "null"))))))
+ (should (equal remote-null-device "null"))))
+
+ ;; Cleanup.
+ (custom-set-variables
+ `(connection-local-profile-alist ',clpa now)
+ `(connection-local-criteria-alist ',clca now))))
(provide 'files-x-tests)
;;; files-x-tests.el ends here
(enable-remote-dir-locals t)
(inhibit-message t)
kill-buffer-query-functions
+ (clpa connection-local-profile-alist)
+ (clca connection-local-criteria-alist)
connection-local-profile-alist connection-local-criteria-alist)
(unwind-protect
(progn
(kill-buffer (current-buffer))))
;; Cleanup.
+ (custom-set-variables
+ `(connection-local-profile-alist ',clpa now)
+ `(connection-local-criteria-alist ',clca now))
(ignore-errors (delete-directory tmp-name1 'recursive)))))
(ert-deftest tramp-test34-explicit-shell-file-name ()
(let ((default-directory ert-remote-temporary-file-directory)
explicit-shell-file-name kill-buffer-query-functions
+ (clpa connection-local-profile-alist)
+ (clca connection-local-criteria-alist)
connection-local-profile-alist connection-local-criteria-alist)
(unwind-protect
(progn
;; Cleanup.
(put 'explicit-shell-file-name 'permanent-local nil)
+ (custom-set-variables
+ `(connection-local-profile-alist ',clpa now)
+ `(connection-local-criteria-alist ',clca now))
(kill-buffer "*shell*"))))
;; `exec-path' was introduced in Emacs 27.1. `executable-find' has