diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/net/tramp-tests.el | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index 79013558fdb..523c7afada8 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el | |||
| @@ -2882,16 +2882,17 @@ This tests also `file-readable-p', `file-regular-p' and | |||
| 2882 | ;; able to return the date correctly. They say "don't know". | 2882 | ;; able to return the date correctly. They say "don't know". |
| 2883 | (dolist (elt attr) | 2883 | (dolist (elt attr) |
| 2884 | (unless | 2884 | (unless |
| 2885 | (zerop | 2885 | (tramp-compat-time-equal-p |
| 2886 | (float-time | 2886 | (nth |
| 2887 | (nth 5 (file-attributes | 2887 | 5 (file-attributes (expand-file-name (car elt) tmp-name2))) |
| 2888 | (expand-file-name (car elt) tmp-name2))))) | 2888 | tramp-time-dont-know) |
| 2889 | (should | 2889 | (should |
| 2890 | (equal (file-attributes (expand-file-name (car elt) tmp-name2)) | 2890 | (equal (file-attributes (expand-file-name (car elt) tmp-name2)) |
| 2891 | (cdr elt))))) | 2891 | (cdr elt))))) |
| 2892 | (setq attr (directory-files-and-attributes tmp-name2 'full)) | 2892 | (setq attr (directory-files-and-attributes tmp-name2 'full)) |
| 2893 | (dolist (elt attr) | 2893 | (dolist (elt attr) |
| 2894 | (unless (zerop (float-time (nth 5 (file-attributes (car elt))))) | 2894 | (unless (tramp-compat-time-equal-p |
| 2895 | (nth 5 (file-attributes (car elt))) tramp-time-dont-know) | ||
| 2895 | (should | 2896 | (should |
| 2896 | (equal (file-attributes (car elt)) (cdr elt))))) | 2897 | (equal (file-attributes (car elt)) (cdr elt))))) |
| 2897 | (setq attr (directory-files-and-attributes tmp-name2 nil "^b")) | 2898 | (setq attr (directory-files-and-attributes tmp-name2 nil "^b")) |
| @@ -3215,14 +3216,13 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 3215 | (write-region "foo" nil tmp-name1) | 3216 | (write-region "foo" nil tmp-name1) |
| 3216 | (should (file-exists-p tmp-name1)) | 3217 | (should (file-exists-p tmp-name1)) |
| 3217 | (should (consp (nth 5 (file-attributes tmp-name1)))) | 3218 | (should (consp (nth 5 (file-attributes tmp-name1)))) |
| 3218 | ;; A zero timestamp means don't know, and will be replaced by | 3219 | ;; Skip the test, if the remote handler is not able to set |
| 3219 | ;; `current-time'. Therefore, use timestamp 1. Skip the | 3220 | ;; the correct time. |
| 3220 | ;; test, if the remote handler is not able to set the | ||
| 3221 | ;; correct time. | ||
| 3222 | (skip-unless (set-file-times tmp-name1 (seconds-to-time 1))) | 3221 | (skip-unless (set-file-times tmp-name1 (seconds-to-time 1))) |
| 3223 | ;; Dumb remote shells without perl(1) or stat(1) are not | 3222 | ;; Dumb remote shells without perl(1) or stat(1) are not |
| 3224 | ;; able to return the date correctly. They say "don't know". | 3223 | ;; able to return the date correctly. They say "don't know". |
| 3225 | (unless (zerop (float-time (nth 5 (file-attributes tmp-name1)))) | 3224 | (unless (tramp-compat-time-equal-p |
| 3225 | (nth 5 (file-attributes tmp-name1)) tramp-time-dont-know) | ||
| 3226 | (should | 3226 | (should |
| 3227 | (equal (nth 5 (file-attributes tmp-name1)) (seconds-to-time 1))) | 3227 | (equal (nth 5 (file-attributes tmp-name1)) (seconds-to-time 1))) |
| 3228 | (write-region "bla" nil tmp-name2) | 3228 | (write-region "bla" nil tmp-name2) |
| @@ -3252,6 +3252,14 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 3252 | (should (verify-visited-file-modtime)) | 3252 | (should (verify-visited-file-modtime)) |
| 3253 | (set-visited-file-modtime (seconds-to-time 1)) | 3253 | (set-visited-file-modtime (seconds-to-time 1)) |
| 3254 | (should (verify-visited-file-modtime)) | 3254 | (should (verify-visited-file-modtime)) |
| 3255 | (should (= 1 (float-time (visited-file-modtime)))) | ||
| 3256 | |||
| 3257 | ;; Checks with deleted file. | ||
| 3258 | (delete-file tmp-name) | ||
| 3259 | (dired-uncache tmp-name) | ||
| 3260 | (should (verify-visited-file-modtime)) | ||
| 3261 | (set-visited-file-modtime (seconds-to-time 1)) | ||
| 3262 | (should (verify-visited-file-modtime)) | ||
| 3255 | (should (= 1 (float-time (visited-file-modtime)))))) | 3263 | (should (= 1 (float-time (visited-file-modtime)))))) |
| 3256 | 3264 | ||
| 3257 | ;; Cleanup. | 3265 | ;; Cleanup. |