aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMichael Albinus2017-03-23 14:58:04 +0100
committerMichael Albinus2017-03-23 14:58:04 +0100
commite1392faae5c5cc7805b52efacbb25a71213afdeb (patch)
treee094f7eeaa13bd26a28f202a51b026e7c9c12017 /test
parente472cfe8f3b01f29a49614f6207e4128e8b36b8c (diff)
downloademacs-e1392faae5c5cc7805b52efacbb25a71213afdeb.tar.gz
emacs-e1392faae5c5cc7805b52efacbb25a71213afdeb.zip
Use lexical-bind in Tramp
* lisp/net/tramp*.el: Add lexical-binding cookie. Move declarations up. * lisp/net/tramp-adb.el (tramp-adb-parse-device-names): Use `push' rather than `add-to-list'. (tramp-adb-get-device): Remove unused variable. * lisp/net/tramp-gvfs.el (tramp-gvfs-parse-device-names): Remove unused variable. * lisp/net/tramp.el (auto-save-file-name-transforms): Declare. (tramp-find-file-name-coding-system-alist): Use `push' rather than `add-to-list'. * test/lisp/net/tramp-tests.el: Add lexical-binding cookie. Require 'dired. Move declarations up. (tramp-test32-make-nearby-temp-file): Wrap `make-nearby-temp-file' and `temporary-file-directory' calls with `with-no-warnings'. (tramp-test35-asynchronous-requests): Mark unused variable.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/net/tramp-tests.el18
1 files changed, 11 insertions, 7 deletions
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index 45b4ff2f5ab..2a4ef740a04 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -1,4 +1,4 @@
1;;; tramp-tests.el --- Tests of remote file access 1;;; tramp-tests.el --- Tests of remote file access -*- lexical-binding:t -*-
2 2
3;; Copyright (C) 2013-2017 Free Software Foundation, Inc. 3;; Copyright (C) 2013-2017 Free Software Foundation, Inc.
4 4
@@ -37,6 +37,7 @@
37 37
38;;; Code: 38;;; Code:
39 39
40(require 'dired)
40(require 'ert) 41(require 'ert)
41(require 'tramp) 42(require 'tramp)
42(require 'vc) 43(require 'vc)
@@ -44,11 +45,11 @@
44(require 'vc-git) 45(require 'vc-git)
45(require 'vc-hg) 46(require 'vc-hg)
46 47
47(autoload 'dired-uncache "dired")
48(declare-function tramp-find-executable "tramp-sh") 48(declare-function tramp-find-executable "tramp-sh")
49(declare-function tramp-get-remote-path "tramp-sh") 49(declare-function tramp-get-remote-path "tramp-sh")
50(declare-function tramp-get-remote-stat "tramp-sh") 50(declare-function tramp-get-remote-stat "tramp-sh")
51(declare-function tramp-get-remote-perl "tramp-sh") 51(declare-function tramp-get-remote-perl "tramp-sh")
52(defvar auto-save-file-name-transforms)
52(defvar tramp-copy-size-limit) 53(defvar tramp-copy-size-limit)
53(defvar tramp-persistency-file-name) 54(defvar tramp-persistency-file-name)
54(defvar tramp-remote-process-environment) 55(defvar tramp-remote-process-environment)
@@ -2083,17 +2084,20 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
2083 (skip-unless 2084 (skip-unless
2084 (and (fboundp 'make-nearby-temp-file) (fboundp 'temporary-file-directory))) 2085 (and (fboundp 'make-nearby-temp-file) (fboundp 'temporary-file-directory)))
2085 2086
2087 ;; `make-nearby-temp-file' and `temporary-file-directory' exists
2088 ;; since Emacs 26. We don't want to see compiler warnings for older
2089 ;; Emacsen."
2086 (let ((default-directory tramp-test-temporary-file-directory) 2090 (let ((default-directory tramp-test-temporary-file-directory)
2087 tmp-file) 2091 tmp-file)
2088 ;; The remote host shall know a temporary file directory. 2092 ;; The remote host shall know a temporary file directory.
2089 (should (stringp (temporary-file-directory))) 2093 (should (stringp (with-no-warnings (temporary-file-directory))))
2090 (should 2094 (should
2091 (string-equal 2095 (string-equal
2092 (file-remote-p default-directory) 2096 (file-remote-p default-directory)
2093 (file-remote-p (temporary-file-directory)))) 2097 (file-remote-p (with-no-warnings (temporary-file-directory)))))
2094 2098
2095 ;; The temporary file shall be located on the remote host. 2099 ;; The temporary file shall be located on the remote host.
2096 (setq tmp-file (make-nearby-temp-file "tramp-test")) 2100 (setq tmp-file (with-no-warnings (make-nearby-temp-file "tramp-test")))
2097 (should (file-exists-p tmp-file)) 2101 (should (file-exists-p tmp-file))
2098 (should (file-regular-p tmp-file)) 2102 (should (file-regular-p tmp-file))
2099 (should 2103 (should
@@ -2103,7 +2107,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
2103 (delete-file tmp-file) 2107 (delete-file tmp-file)
2104 (should-not (file-exists-p tmp-file)) 2108 (should-not (file-exists-p tmp-file))
2105 2109
2106 (setq tmp-file (make-nearby-temp-file "tramp-test" 'dir)) 2110 (setq tmp-file (with-no-warnings (make-nearby-temp-file "tramp-test" 'dir)))
2107 (should (file-exists-p tmp-file)) 2111 (should (file-exists-p tmp-file))
2108 (should (file-directory-p tmp-file)) 2112 (should (file-directory-p tmp-file))
2109 (delete-directory tmp-file) 2113 (delete-directory tmp-file)
@@ -2582,7 +2586,7 @@ process sentinels. They shall not disturb each other."
2582 ;; Create temporary buffers. The number of buffers 2586 ;; Create temporary buffers. The number of buffers
2583 ;; corresponds to the number of processes; it could be 2587 ;; corresponds to the number of processes; it could be
2584 ;; increased in order to make pressure on Tramp. 2588 ;; increased in order to make pressure on Tramp.
2585 (dotimes (i 5) 2589 (dotimes (_i 5)
2586 (add-to-list 'buffers (generate-new-buffer "*temp*"))) 2590 (add-to-list 'buffers (generate-new-buffer "*temp*")))
2587 2591
2588 ;; Open asynchronous processes. Set process sentinel. 2592 ;; Open asynchronous processes. Set process sentinel.