emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 78ddf6b 2/2: Improve time arithmetic in tramp--test


From: Michael Albinus
Subject: [Emacs-diffs] master 78ddf6b 2/2: Improve time arithmetic in tramp--test-file-attributes-equal-p
Date: Thu, 8 Aug 2019 09:43:03 -0400 (EDT)

branch: master
commit 78ddf6ba96039920d9ac0086b8a87a8a068227ef
Author: Michael Albinus <address@hidden>
Commit: Michael Albinus <address@hidden>

    Improve time arithmetic in tramp--test-file-attributes-equal-p
    
    * test/lisp/net/tramp-tests.el (tramp--test-file-attributes-equal-p):
    Improve time arithmetic.
---
 test/lisp/net/tramp-tests.el | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index bcc74cc..7a1ae52 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -3089,9 +3089,11 @@ They might differ only in time attributes or directory 
size."
   (let ((attr1 (copy-sequence attr1))
        (attr2 (copy-sequence attr2))
        (start-time
-        (aref
-         (ert--stats-test-start-times ert--current-run-stats)
-         (ert--stats-test-pos ert--current-run-stats (ert-running-test)))))
+        (floor
+         (float-time
+          (aref
+           (ert--stats-test-start-times ert--current-run-stats)
+           (ert--stats-test-pos ert--current-run-stats (ert-running-test)))))))
     ;; Access time.
     (setcar (nthcdr 4 attr1) tramp-time-dont-know)
     (setcar (nthcdr 4 attr2) tramp-time-dont-know)
@@ -3104,24 +3106,25 @@ They might differ only in time attributes or directory 
size."
              (tramp-compat-time-equal-p (nth 5 attr2) tramp-time-dont-know))
       (setcar (nthcdr 5 attr1) tramp-time-dont-know)
       (setcar (nthcdr 5 attr2) tramp-time-dont-know))
-    (when (time-less-p start-time (nth 5 attr1))
+    (when (<= start-time (floor (float-time (nth 5 attr1))))
       (setcar (nthcdr 5 attr1) tramp-time-dont-know))
-    (when (time-less-p start-time (nth 5 attr2))
+    (when (<= start-time (floor (float-time (nth 5 attr2))))
       (setcar (nthcdr 5 attr2) tramp-time-dont-know))
     ;; Status change time.  Dito.
     (when (or (tramp-compat-time-equal-p (nth 6 attr1) tramp-time-dont-know)
              (tramp-compat-time-equal-p (nth 6 attr2) tramp-time-dont-know))
       (setcar (nthcdr 6 attr1) tramp-time-dont-know)
       (setcar (nthcdr 6 attr2) tramp-time-dont-know))
-    (when (time-less-p start-time (nth 6 attr1))
+    (when (<= start-time (floor (float-time (nth 6 attr1))))
       (setcar (nthcdr 6 attr1) tramp-time-dont-know))
-    (when (time-less-p start-time (nth 6 attr2))
+    (when (<= start-time (floor (float-time (nth 6 attr2))))
       (setcar (nthcdr 6 attr2) tramp-time-dont-know))
     ;; Size.  Set it to 0 for directories, because it might have
     ;; changed.  For example the upper directory "../".
     (when (eq (car attr1) t) (setcar (nthcdr 7 attr1) 0))
     (when (eq (car attr2) t) (setcar (nthcdr 7 attr2) 0))
     ;; The check.
+    (unless (equal attr1 attr2) (tramp--test-message "%S\n%S" attr1 attr2))
     (equal attr1 attr2)))
 
 ;; This isn't 100% correct, but better than no explainer at all.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]