diff options
| author | K. Handa | 2016-06-01 08:07:18 +0900 |
|---|---|---|
| committer | K. Handa | 2016-06-01 08:07:18 +0900 |
| commit | 4efef3db2fb1c3a20b83a67948e614d9b0c258dd (patch) | |
| tree | c0c08fc308869f7ba3d988594e4a51b69a70325b /test | |
| parent | 694d5e5b56a9d55023ffc292188bd88f6f6cbca6 (diff) | |
| parent | 01030eed9395f5004e7d0721394697d1ca90cc2f (diff) | |
| download | emacs-4efef3db2fb1c3a20b83a67948e614d9b0c258dd.tar.gz emacs-4efef3db2fb1c3a20b83a67948e614d9b0c258dd.zip | |
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/net/tramp-tests.el | 44 |
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'." | |||
| 1405 | (make-directory tmp-name) | 1405 | (make-directory tmp-name) |
| 1406 | (should (file-directory-p tmp-name)) | 1406 | (should (file-directory-p tmp-name)) |
| 1407 | (write-region "foo" nil (expand-file-name "foo" tmp-name)) | 1407 | (write-region "foo" nil (expand-file-name "foo" tmp-name)) |
| 1408 | (should (file-exists-p (expand-file-name "foo" tmp-name))) | ||
| 1408 | (write-region "bar" nil (expand-file-name "bold" tmp-name)) | 1409 | (write-region "bar" nil (expand-file-name "bold" tmp-name)) |
| 1410 | (should (file-exists-p (expand-file-name "bold" tmp-name))) | ||
| 1409 | (make-directory (expand-file-name "boz" tmp-name)) | 1411 | (make-directory (expand-file-name "boz" tmp-name)) |
| 1412 | (should (file-directory-p (expand-file-name "boz" tmp-name))) | ||
| 1410 | (should (equal (file-name-completion "fo" tmp-name) "foo")) | 1413 | (should (equal (file-name-completion "fo" tmp-name) "foo")) |
| 1414 | (should (equal (file-name-completion "foo" tmp-name) t)) | ||
| 1411 | (should (equal (file-name-completion "b" tmp-name) "bo")) | 1415 | (should (equal (file-name-completion "b" tmp-name) "bo")) |
| 1416 | (should-not (file-name-completion "a" tmp-name)) | ||
| 1412 | (should | 1417 | (should |
| 1413 | (equal | 1418 | (equal |
| 1414 | (file-name-completion "b" tmp-name 'file-directory-p) "boz/")) | 1419 | (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'." | |||
| 1416 | (should | 1421 | (should |
| 1417 | (equal | 1422 | (equal |
| 1418 | (sort (file-name-all-completions "b" tmp-name) 'string-lessp) | 1423 | (sort (file-name-all-completions "b" tmp-name) 'string-lessp) |
| 1419 | '("bold" "boz/")))) | 1424 | '("bold" "boz/"))) |
| 1425 | (should-not (file-name-all-completions "a" tmp-name)) | ||
| 1426 | ;; `completion-regexp-list' restricts the completion to | ||
| 1427 | ;; files which match all expressions in this list. | ||
| 1428 | (let ((completion-regexp-list | ||
| 1429 | `(,directory-files-no-dot-files-regexp "b"))) | ||
| 1430 | (should | ||
| 1431 | (equal (file-name-completion "" tmp-name) "bo")) | ||
| 1432 | (should | ||
| 1433 | (equal | ||
| 1434 | (sort (file-name-all-completions "" tmp-name) 'string-lessp) | ||
| 1435 | '("bold" "boz/")))) | ||
| 1436 | ;; `file-name-completion' ignores file names that end in | ||
| 1437 | ;; any string in `completion-ignored-extensions'. | ||
| 1438 | (let ((completion-ignored-extensions '(".ext"))) | ||
| 1439 | (write-region "foo" nil (expand-file-name "foo.ext" tmp-name)) | ||
| 1440 | (should (file-exists-p (expand-file-name "foo.ext" tmp-name))) | ||
| 1441 | (should (equal (file-name-completion "fo" tmp-name) "foo")) | ||
| 1442 | (should (equal (file-name-completion "foo" tmp-name) t)) | ||
| 1443 | (should (equal (file-name-completion "foo." tmp-name) "foo.ext")) | ||
| 1444 | (should (equal (file-name-completion "foo.ext" tmp-name) t)) | ||
| 1445 | ;; `file-name-all-completions' is not affected. | ||
| 1446 | (should | ||
| 1447 | (equal | ||
| 1448 | (sort (file-name-all-completions "" tmp-name) 'string-lessp) | ||
| 1449 | '("../" "./" "bold" "boz/" "foo" "foo.ext"))))) | ||
| 1420 | 1450 | ||
| 1421 | ;; Cleanup. | 1451 | ;; Cleanup. |
| 1422 | (ignore-errors (delete-directory tmp-name 'recursive)))))) | 1452 | (ignore-errors (delete-directory tmp-name 'recursive)))))) |
| @@ -1468,7 +1498,8 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 1468 | (should (zerop (process-file "ls" nil t nil fnnd))) | 1498 | (should (zerop (process-file "ls" nil t nil fnnd))) |
| 1469 | ;; `ls' could produce colorized output. | 1499 | ;; `ls' could produce colorized output. |
| 1470 | (goto-char (point-min)) | 1500 | (goto-char (point-min)) |
| 1471 | (while (re-search-forward tramp-color-escape-sequence-regexp nil t) | 1501 | (while |
| 1502 | (re-search-forward tramp-display-escape-sequence-regexp nil t) | ||
| 1472 | (replace-match "" nil nil)) | 1503 | (replace-match "" nil nil)) |
| 1473 | (should (string-equal (format "%s\n" fnnd) (buffer-string))) | 1504 | (should (string-equal (format "%s\n" fnnd) (buffer-string))) |
| 1474 | (should-not (get-buffer-window (current-buffer) t)) | 1505 | (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'." | |||
| 1478 | (should (zerop (process-file "ls" nil t t fnnd))) | 1509 | (should (zerop (process-file "ls" nil t t fnnd))) |
| 1479 | ;; `ls' could produce colorized output. | 1510 | ;; `ls' could produce colorized output. |
| 1480 | (goto-char (point-min)) | 1511 | (goto-char (point-min)) |
| 1481 | (while (re-search-forward tramp-color-escape-sequence-regexp nil t) | 1512 | (while |
| 1513 | (re-search-forward tramp-display-escape-sequence-regexp nil t) | ||
| 1482 | (replace-match "" nil nil)) | 1514 | (replace-match "" nil nil)) |
| 1483 | (should | 1515 | (should |
| 1484 | (string-equal (format "%s\n%s\n" fnnd fnnd) (buffer-string))) | 1516 | (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'." | |||
| 1581 | (format "ls %s" (file-name-nondirectory tmp-name)) (current-buffer)) | 1613 | (format "ls %s" (file-name-nondirectory tmp-name)) (current-buffer)) |
| 1582 | ;; `ls' could produce colorized output. | 1614 | ;; `ls' could produce colorized output. |
| 1583 | (goto-char (point-min)) | 1615 | (goto-char (point-min)) |
| 1584 | (while (re-search-forward tramp-color-escape-sequence-regexp nil t) | 1616 | (while (re-search-forward tramp-display-escape-sequence-regexp nil t) |
| 1585 | (replace-match "" nil nil)) | 1617 | (replace-match "" nil nil)) |
| 1586 | (should | 1618 | (should |
| 1587 | (string-equal | 1619 | (string-equal |
| @@ -1604,7 +1636,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 1604 | (accept-process-output (get-buffer-process (current-buffer)) 1))) | 1636 | (accept-process-output (get-buffer-process (current-buffer)) 1))) |
| 1605 | ;; `ls' could produce colorized output. | 1637 | ;; `ls' could produce colorized output. |
| 1606 | (goto-char (point-min)) | 1638 | (goto-char (point-min)) |
| 1607 | (while (re-search-forward tramp-color-escape-sequence-regexp nil t) | 1639 | (while (re-search-forward tramp-display-escape-sequence-regexp nil t) |
| 1608 | (replace-match "" nil nil)) | 1640 | (replace-match "" nil nil)) |
| 1609 | ;; There might be a nasty "Process *Async Shell* finished" message. | 1641 | ;; There might be a nasty "Process *Async Shell* finished" message. |
| 1610 | (goto-char (point-min)) | 1642 | (goto-char (point-min)) |
| @@ -1633,7 +1665,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 1633 | (accept-process-output (get-buffer-process (current-buffer)) 1))) | 1665 | (accept-process-output (get-buffer-process (current-buffer)) 1))) |
| 1634 | ;; `ls' could produce colorized output. | 1666 | ;; `ls' could produce colorized output. |
| 1635 | (goto-char (point-min)) | 1667 | (goto-char (point-min)) |
| 1636 | (while (re-search-forward tramp-color-escape-sequence-regexp nil t) | 1668 | (while (re-search-forward tramp-display-escape-sequence-regexp nil t) |
| 1637 | (replace-match "" nil nil)) | 1669 | (replace-match "" nil nil)) |
| 1638 | ;; There might be a nasty "Process *Async Shell* finished" message. | 1670 | ;; There might be a nasty "Process *Async Shell* finished" message. |
| 1639 | (goto-char (point-min)) | 1671 | (goto-char (point-min)) |