summaryrefslogtreecommitdiff
path: root/test/lisp
diff options
context:
space:
mode:
authorK. Handa <handa@gnu.org>2016-06-01 08:07:18 +0900
committerK. Handa <handa@gnu.org>2016-06-01 08:07:18 +0900
commit4efef3db2fb1c3a20b83a67948e614d9b0c258dd (patch)
treec0c08fc308869f7ba3d988594e4a51b69a70325b /test/lisp
parent694d5e5b56a9d55023ffc292188bd88f6f6cbca6 (diff)
parent01030eed9395f5004e7d0721394697d1ca90cc2f (diff)
downloademacs-4efef3db2fb1c3a20b83a67948e614d9b0c258dd.tar.gz
emacs-4efef3db2fb1c3a20b83a67948e614d9b0c258dd.tar.bz2
emacs-4efef3db2fb1c3a20b83a67948e614d9b0c258dd.zip
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs
Diffstat (limited to 'test/lisp')
-rw-r--r--test/lisp/net/tramp-tests.el44
1 files changed, 38 insertions, 6 deletions
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index 468ed4a36ff..a8d89e87c2d 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -1405,10 +1405,15 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
(make-directory tmp-name)
(should (file-directory-p tmp-name))
(write-region "foo" nil (expand-file-name "foo" tmp-name))
+ (should (file-exists-p (expand-file-name "foo" tmp-name)))
(write-region "bar" nil (expand-file-name "bold" tmp-name))
+ (should (file-exists-p (expand-file-name "bold" tmp-name)))
(make-directory (expand-file-name "boz" tmp-name))
+ (should (file-directory-p (expand-file-name "boz" tmp-name)))
(should (equal (file-name-completion "fo" tmp-name) "foo"))
+ (should (equal (file-name-completion "foo" tmp-name) t))
(should (equal (file-name-completion "b" tmp-name) "bo"))
+ (should-not (file-name-completion "a" tmp-name))
(should
(equal
(file-name-completion "b" tmp-name 'file-directory-p) "boz/"))
@@ -1416,7 +1421,32 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
(should
(equal
(sort (file-name-all-completions "b" tmp-name) 'string-lessp)
- '("bold" "boz/"))))
+ '("bold" "boz/")))
+ (should-not (file-name-all-completions "a" tmp-name))
+ ;; `completion-regexp-list' restricts the completion to
+ ;; files which match all expressions in this list.
+ (let ((completion-regexp-list
+ `(,directory-files-no-dot-files-regexp "b")))
+ (should
+ (equal (file-name-completion "" tmp-name) "bo"))
+ (should
+ (equal
+ (sort (file-name-all-completions "" tmp-name) 'string-lessp)
+ '("bold" "boz/"))))
+ ;; `file-name-completion' ignores file names that end in
+ ;; any string in `completion-ignored-extensions'.
+ (let ((completion-ignored-extensions '(".ext")))
+ (write-region "foo" nil (expand-file-name "foo.ext" tmp-name))
+ (should (file-exists-p (expand-file-name "foo.ext" tmp-name)))
+ (should (equal (file-name-completion "fo" tmp-name) "foo"))
+ (should (equal (file-name-completion "foo" tmp-name) t))
+ (should (equal (file-name-completion "foo." tmp-name) "foo.ext"))
+ (should (equal (file-name-completion "foo.ext" tmp-name) t))
+ ;; `file-name-all-completions' is not affected.
+ (should
+ (equal
+ (sort (file-name-all-completions "" tmp-name) 'string-lessp)
+ '("../" "./" "bold" "boz/" "foo" "foo.ext")))))
;; Cleanup.
(ignore-errors (delete-directory tmp-name 'recursive))))))
@@ -1468,7 +1498,8 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
(should (zerop (process-file "ls" nil t nil fnnd)))
;; `ls' could produce colorized output.
(goto-char (point-min))
- (while (re-search-forward tramp-color-escape-sequence-regexp nil t)
+ (while
+ (re-search-forward tramp-display-escape-sequence-regexp nil t)
(replace-match "" nil nil))
(should (string-equal (format "%s\n" fnnd) (buffer-string)))
(should-not (get-buffer-window (current-buffer) t))
@@ -1478,7 +1509,8 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
(should (zerop (process-file "ls" nil t t fnnd)))
;; `ls' could produce colorized output.
(goto-char (point-min))
- (while (re-search-forward tramp-color-escape-sequence-regexp nil t)
+ (while
+ (re-search-forward tramp-display-escape-sequence-regexp nil t)
(replace-match "" nil nil))
(should
(string-equal (format "%s\n%s\n" fnnd fnnd) (buffer-string)))
@@ -1581,7 +1613,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
(format "ls %s" (file-name-nondirectory tmp-name)) (current-buffer))
;; `ls' could produce colorized output.
(goto-char (point-min))
- (while (re-search-forward tramp-color-escape-sequence-regexp nil t)
+ (while (re-search-forward tramp-display-escape-sequence-regexp nil t)
(replace-match "" nil nil))
(should
(string-equal
@@ -1604,7 +1636,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
(accept-process-output (get-buffer-process (current-buffer)) 1)))
;; `ls' could produce colorized output.
(goto-char (point-min))
- (while (re-search-forward tramp-color-escape-sequence-regexp nil t)
+ (while (re-search-forward tramp-display-escape-sequence-regexp nil t)
(replace-match "" nil nil))
;; There might be a nasty "Process *Async Shell* finished" message.
(goto-char (point-min))
@@ -1633,7 +1665,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
(accept-process-output (get-buffer-process (current-buffer)) 1)))
;; `ls' could produce colorized output.
(goto-char (point-min))
- (while (re-search-forward tramp-color-escape-sequence-regexp nil t)
+ (while (re-search-forward tramp-display-escape-sequence-regexp nil t)
(replace-match "" nil nil))
;; There might be a nasty "Process *Async Shell* finished" message.
(goto-char (point-min))