diff options
| author | Michael Albinus | 2022-09-04 13:44:30 +0200 |
|---|---|---|
| committer | Michael Albinus | 2022-09-04 13:44:30 +0200 |
| commit | f1635c8efb30cd42b83e31aa29be58aeb2965a9a (patch) | |
| tree | 639df60e90b7f2b36fd9979fb8610b73efe1b87f /test | |
| parent | 4751b51d5e1182975aa002af08a625e4859ec276 (diff) | |
| download | emacs-f1635c8efb30cd42b83e31aa29be58aeb2965a9a.tar.gz emacs-f1635c8efb30cd42b83e31aa29be58aeb2965a9a.zip | |
Fix rx forms in Tramp
* lisp/net/tramp.el (tramp-restricted-shell-hosts-alist)
(tramp-local-host-regexp, tramp-echoed-echo-mark-regexp)
(tramp-login-prompt-regexp, tramp-terminal-prompt-regexp)
(tramp-antispoof-regexp)
(tramp-build-completion-file-name-regexp)
(tramp-debug-outline-regexp)
(tramp-use-absolute-autoload-file-names)
(tramp-lock-file-info-regexp, tramp-shell-quote-argument):
* lisp/net/tramp-adb.el (tramp-do-parse-file-attributes-with-ls)
* lisp/net/tramp-cache.el (tramp-flush-file-function):
* lisp/net/tramp-gvfs.el (tramp-gvfs-file-name):
* lisp/net/tramp-integration.el (tramp-rfn-eshadow-update-overlay-regexp)
(info-lookup-maybe-add-help):
* lisp/net/tramp-sh.el (tramp-default-user-alist, tramp-sunos-unames)
(tramp-scp-direct-remote-copying, tramp-get-remote-locale):
* lisp/net/tramp-smb.el (tramp-smb-prompt, tramp-smb-wrong-passwd-regexp)
(tramp-smb-errors, tramp-smb-get-localname)
(tramp-smb-read-file-entry): Simplify rx forms.
* lisp/net/tramp.el (tramp-handle-find-backup-file-name)
(tramp-handle-lock-file, tramp-handle-make-auto-save-file-name):
* lisp/net/tramp-adb.el (tramp-adb-handle-set-file-times)
(tramp-adb-maybe-open-connection):
* lisp/net/tramp-gvfs.el
(tramp-gvfs-file-attributes-with-gvfs-ls-regexp):
* lisp/net/tramp-sh.el (tramp-open-shell, tramp-find-shell): Do not use
`eval-when-compile'.
* lisp/net/tramp-cmds.el (tramp-rename-files, tramp-rename-these-files):
Use rx.
* lisp/net/tramp-gvfs.el (tramp-gvfs-password-tcrypt): New defonst.
(tramp-gvfs-handle-file-attributes): Use `number-to-string'.
* test/lisp/net/tramp-archive-tests.el
(tramp-archive-test17-insert-directory):
* test/lisp/net/tramp-tests.el (tramp-test17-insert-directory)
(tramp--test-share-p): Simplify rx forms.
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/net/tramp-archive-tests.el | 8 | ||||
| -rw-r--r-- | test/lisp/net/tramp-tests.el | 10 |
2 files changed, 9 insertions, 9 deletions
diff --git a/test/lisp/net/tramp-archive-tests.el b/test/lisp/net/tramp-archive-tests.el index 964404b4bf7..aa5d1cc496c 100644 --- a/test/lisp/net/tramp-archive-tests.el +++ b/test/lisp/net/tramp-archive-tests.el | |||
| @@ -622,7 +622,7 @@ This checks also `file-name-as-directory', `file-name-directory', | |||
| 622 | (goto-char (point-min)) | 622 | (goto-char (point-min)) |
| 623 | (should | 623 | (should |
| 624 | (looking-at-p | 624 | (looking-at-p |
| 625 | (rx bol (+ nonl) " " (literal tramp-archive-test-archive) eol)))) | 625 | (rx bol (+ nonl) space (literal tramp-archive-test-archive) eol)))) |
| 626 | (with-temp-buffer | 626 | (with-temp-buffer |
| 627 | (insert-directory | 627 | (insert-directory |
| 628 | (file-name-as-directory tramp-archive-test-archive) | 628 | (file-name-as-directory tramp-archive-test-archive) |
| @@ -633,14 +633,14 @@ This checks also `file-name-as-directory', `file-name-directory', | |||
| 633 | (rx-to-string | 633 | (rx-to-string |
| 634 | `(: | 634 | `(: |
| 635 | ;; There might be a summary line. | 635 | ;; There might be a summary line. |
| 636 | (? "total" (+ nonl) (+ digit) (? " ") | 636 | (? "total" (+ nonl) (+ digit) (? space) |
| 637 | (? (any "EGKMPTYZk")) (? "i") (? "B") "\n") | 637 | (? (any "EGKMPTYZk")) (? "i") (? "B") "\n") |
| 638 | ;; We don't know in which order the files appear. | 638 | ;; We don't know in which order the files appear. |
| 639 | (= ,(length (directory-files tramp-archive-test-archive)) | 639 | (= ,(length (directory-files tramp-archive-test-archive)) |
| 640 | (+ nonl) " " | 640 | (+ nonl) space |
| 641 | (regexp | 641 | (regexp |
| 642 | ,(regexp-opt (directory-files tramp-archive-test-archive))) | 642 | ,(regexp-opt (directory-files tramp-archive-test-archive))) |
| 643 | (? " ->" (one-or-more nonl)) "\n")))))) | 643 | (? " ->" (+ nonl)) "\n")))))) |
| 644 | ;; Check error case. | 644 | ;; Check error case. |
| 645 | (with-temp-buffer | 645 | (with-temp-buffer |
| 646 | (should-error | 646 | (should-error |
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index bc67ff2ace7..fed1d881c57 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el | |||
| @@ -3222,13 +3222,13 @@ This tests also `file-directory-p' and `file-accessible-directory-p'." | |||
| 3222 | (insert-directory tmp-name1 "-al") | 3222 | (insert-directory tmp-name1 "-al") |
| 3223 | (goto-char (point-min)) | 3223 | (goto-char (point-min)) |
| 3224 | (should | 3224 | (should |
| 3225 | (looking-at-p (rx bol (+ nonl) " " (literal tmp-name1) eol)))) | 3225 | (looking-at-p (rx bol (+ nonl) space (literal tmp-name1) eol)))) |
| 3226 | (with-temp-buffer | 3226 | (with-temp-buffer |
| 3227 | (insert-directory (file-name-as-directory tmp-name1) "-al") | 3227 | (insert-directory (file-name-as-directory tmp-name1) "-al") |
| 3228 | (goto-char (point-min)) | 3228 | (goto-char (point-min)) |
| 3229 | (should | 3229 | (should |
| 3230 | (looking-at-p | 3230 | (looking-at-p |
| 3231 | (rx bol (+ nonl) " " (literal tmp-name1) "/" eol)))) | 3231 | (rx bol (+ nonl) space (literal tmp-name1) "/" eol)))) |
| 3232 | (with-temp-buffer | 3232 | (with-temp-buffer |
| 3233 | (insert-directory | 3233 | (insert-directory |
| 3234 | (file-name-as-directory tmp-name1) "-al" nil 'full-directory-p) | 3234 | (file-name-as-directory tmp-name1) "-al" nil 'full-directory-p) |
| @@ -3238,11 +3238,11 @@ This tests also `file-directory-p' and `file-accessible-directory-p'." | |||
| 3238 | (rx-to-string | 3238 | (rx-to-string |
| 3239 | `(: | 3239 | `(: |
| 3240 | ;; There might be a summary line. | 3240 | ;; There might be a summary line. |
| 3241 | (? "total" (+ nonl) (+ digit) (? " ") | 3241 | (? "total" (+ nonl) (+ digit) (? space) |
| 3242 | (? (any "EGKMPTYZk")) (? "i") (? "B") "\n") | 3242 | (? (any "EGKMPTYZk")) (? "i") (? "B") "\n") |
| 3243 | ;; We don't know in which order ".", ".." and "foo" appear. | 3243 | ;; We don't know in which order ".", ".." and "foo" appear. |
| 3244 | (= ,(length (directory-files tmp-name1)) | 3244 | (= ,(length (directory-files tmp-name1)) |
| 3245 | (+ nonl) " " | 3245 | (+ nonl) space |
| 3246 | (regexp ,(regexp-opt (directory-files tmp-name1))) | 3246 | (regexp ,(regexp-opt (directory-files tmp-name1))) |
| 3247 | (? " ->" (+ nonl)) "\n")))))) | 3247 | (? " ->" (+ nonl)) "\n")))))) |
| 3248 | 3248 | ||
| @@ -6703,7 +6703,7 @@ Additionally, ls does not support \"--dired\"." | |||
| 6703 | "Check, whether the method needs a share." | 6703 | "Check, whether the method needs a share." |
| 6704 | (and (tramp--test-gvfs-p) | 6704 | (and (tramp--test-gvfs-p) |
| 6705 | (string-match-p | 6705 | (string-match-p |
| 6706 | (rx bol (or "afp" (: "dav" (opt "s")) "smb") eol) | 6706 | (rx bol (| "afp" (: "dav" (? "s")) "smb") eol) |
| 6707 | (file-remote-p ert-remote-temporary-file-directory 'method)))) | 6707 | (file-remote-p ert-remote-temporary-file-directory 'method)))) |
| 6708 | 6708 | ||
| 6709 | (defun tramp--test-sshfs-p () | 6709 | (defun tramp--test-sshfs-p () |