Hi all,

A clean clone of org-mode turns up two test failures for me (test-org/deadline-close-p and test-org/refile-get-targets), which I believe are false failures. The attached (tiny) patch addresses them both.


test-org/deadline-close-p fails due to a time zone difference. The test assumes that a current time of '(22353 6425 905205 644000) corresponds to 2016-06-03 Fri 01:43, but in my timezone it corresponds to 2016-06-02 Thu 22:43.

test-org/refile-get-targets fails because on macOS /tmp is a symlink to /private/tmp, and refile-get-targets resolves symlinks, but the test does not.

Best,

Galen
From 8839e982b2177bd740ef3a88f6a999a30fd62698 Mon Sep 17 00:00:00 2001
From: Galen Menzel <galen.men...@utexas.edu>
Date: Tue, 8 Aug 2017 14:31:39 -0700
Subject: [PATCH] test-org.el: Fix two false test failures

* testing/lisp/test-org.el (test-org/deadline-close-p): Fix false
failures due to time-zone differences.
(test-org/refile-get-targets): Fix false failures when test temp-file
path contains a symlink.

TINYCHANGE
---
 testing/lisp/test-org.el | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el
index 372bf69c3..f2eda045f 100644
--- a/testing/lisp/test-org.el
+++ b/testing/lisp/test-org.el
@@ -375,7 +375,9 @@
   "Test `org-deadline-close-p' specifications."
   ;; Pretend that the current time is 2016-06-03 Fri 01:43
   (cl-letf (((symbol-function 'current-time)
-            (lambda () '(22353 6425 905205 644000))))
+            (lambda ()
+              (apply #'encode-time
+                     (org-parse-time-string "2016-06-03 Fri 01:43")))))
     ;; Timestamps are close if they are within `ndays' of lead time.
     (org-test-with-temp-text "* Heading"
       (should (org-deadline-close-p "2016-06-03 Fri" 0))
@@ -5478,7 +5480,7 @@ Paragraph<point>"
   ;; full file name.
   (should
    (org-test-with-temp-text-in-file "* H1"
-     (let* ((filename (buffer-file-name))
+     (let* ((filename (file-truename (buffer-file-name)))
            (org-refile-use-outline-path 'full-file-path)
            (org-refile-targets `(((,filename) :level . 1))))
        (member filename (mapcar #'car (org-refile-get-targets))))))
-- 
2.14.0

Reply via email to