diff options
| author | Michael Albinus | 2019-08-06 21:47:57 +0200 |
|---|---|---|
| committer | Michael Albinus | 2019-08-06 21:47:57 +0200 |
| commit | 998f3612f7e3732d43d8cc6827a16a29008f5db5 (patch) | |
| tree | e77ed448546f78f1408521be51086718768f59f7 | |
| parent | 7f0de07b3ac67370bfe78faac9c6bffdd90d55ce (diff) | |
| download | emacs-998f3612f7e3732d43d8cc6827a16a29008f5db5.tar.gz emacs-998f3612f7e3732d43d8cc6827a16a29008f5db5.zip | |
Fix Bug#36940
* test/lisp/net/tramp-tests.el (tramp--test-file-attributes-equal-p):
Make the check more precise. (Bug#36940)
(tramp-test19-directory-files-and-attributes): Move some checks to
`tramp--test-file-attributes-equal-p'.
| -rw-r--r-- | test/lisp/net/tramp-tests.el | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index d49914797f5..7ec709a4a6e 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el | |||
| @@ -3090,11 +3090,15 @@ They might differ only in time attributes." | |||
| 3090 | (setcar (nthcdr 4 attr1) tramp-time-dont-know) | 3090 | (setcar (nthcdr 4 attr1) tramp-time-dont-know) |
| 3091 | (setcar (nthcdr 4 attr2) tramp-time-dont-know) | 3091 | (setcar (nthcdr 4 attr2) tramp-time-dont-know) |
| 3092 | ;; Modification time. | 3092 | ;; Modification time. |
| 3093 | (when (< (abs (tramp-time-diff (nth 5 attr1) (nth 5 attr2))) 5) | 3093 | (when (or (tramp-compat-time-equal-p (nth 5 attr1) tramp-time-dont-know) |
| 3094 | (tramp-compat-time-equal-p (nth 5 attr2) tramp-time-dont-know) | ||
| 3095 | (< (abs (tramp-time-diff (nth 5 attr1) (nth 5 attr2))) 5)) | ||
| 3094 | (setcar (nthcdr 5 attr1) tramp-time-dont-know) | 3096 | (setcar (nthcdr 5 attr1) tramp-time-dont-know) |
| 3095 | (setcar (nthcdr 5 attr2) tramp-time-dont-know)) | 3097 | (setcar (nthcdr 5 attr2) tramp-time-dont-know)) |
| 3096 | ;; Status change time. | 3098 | ;; Status change time. |
| 3097 | (when (< (abs (tramp-time-diff (nth 6 attr1) (nth 6 attr2))) 5) | 3099 | (when (or (tramp-compat-time-equal-p (nth 6 attr1) tramp-time-dont-know) |
| 3100 | (tramp-compat-time-equal-p (nth 6 attr2) tramp-time-dont-know) | ||
| 3101 | (< (abs (tramp-time-diff (nth 6 attr1) (nth 6 attr2))) 5)) | ||
| 3098 | (setcar (nthcdr 6 attr1) tramp-time-dont-know) | 3102 | (setcar (nthcdr 6 attr1) tramp-time-dont-know) |
| 3099 | (setcar (nthcdr 6 attr2) tramp-time-dont-know)) | 3103 | (setcar (nthcdr 6 attr2) tramp-time-dont-know)) |
| 3100 | (equal attr1 attr2)) | 3104 | (equal attr1 attr2)) |
| @@ -3122,27 +3126,22 @@ They might differ only in time attributes." | |||
| 3122 | (write-region "foo" nil (expand-file-name "foo" tmp-name2)) | 3126 | (write-region "foo" nil (expand-file-name "foo" tmp-name2)) |
| 3123 | (write-region "bar" nil (expand-file-name "bar" tmp-name2)) | 3127 | (write-region "bar" nil (expand-file-name "bar" tmp-name2)) |
| 3124 | (write-region "boz" nil (expand-file-name "boz" tmp-name2)) | 3128 | (write-region "boz" nil (expand-file-name "boz" tmp-name2)) |
| 3129 | |||
| 3125 | (setq attr (directory-files-and-attributes tmp-name2)) | 3130 | (setq attr (directory-files-and-attributes tmp-name2)) |
| 3126 | (should (consp attr)) | 3131 | (should (consp attr)) |
| 3127 | ;; Dumb remote shells without perl(1) or stat(1) are not | ||
| 3128 | ;; able to return the date correctly. They say "don't know". | ||
| 3129 | (dolist (elt attr) | 3132 | (dolist (elt attr) |
| 3130 | (unless | 3133 | (should |
| 3131 | (tramp-compat-time-equal-p | 3134 | (tramp--test-file-attributes-equal-p |
| 3132 | (nth | 3135 | (file-attributes (expand-file-name (car elt) tmp-name2)) |
| 3133 | 5 (file-attributes (expand-file-name (car elt) tmp-name2))) | 3136 | (cdr elt)))) |
| 3134 | tramp-time-dont-know) | 3137 | |
| 3135 | (should | ||
| 3136 | (tramp--test-file-attributes-equal-p | ||
| 3137 | (file-attributes (expand-file-name (car elt) tmp-name2)) | ||
| 3138 | (cdr elt))))) | ||
| 3139 | (setq attr (directory-files-and-attributes tmp-name2 'full)) | 3138 | (setq attr (directory-files-and-attributes tmp-name2 'full)) |
| 3139 | (should (consp attr)) | ||
| 3140 | (dolist (elt attr) | 3140 | (dolist (elt attr) |
| 3141 | (unless (tramp-compat-time-equal-p | 3141 | (should |
| 3142 | (nth 5 (file-attributes (car elt))) tramp-time-dont-know) | 3142 | (tramp--test-file-attributes-equal-p |
| 3143 | (should | 3143 | (file-attributes (car elt)) (cdr elt)))) |
| 3144 | (tramp--test-file-attributes-equal-p | 3144 | |
| 3145 | (file-attributes (car elt)) (cdr elt))))) | ||
| 3146 | (setq attr (directory-files-and-attributes tmp-name2 nil "^b")) | 3145 | (setq attr (directory-files-and-attributes tmp-name2 nil "^b")) |
| 3147 | (should (equal (mapcar #'car attr) '("bar" "boz")))) | 3146 | (should (equal (mapcar #'car attr) '("bar" "boz")))) |
| 3148 | 3147 | ||