From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Galen Menzel" Subject: [PATCH] Fix two false failures in org's test suite Date: Tue, 08 Aug 2017 15:37:26 -0700 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=_MailMate_2B7521A0-DBC5-4BD1-9F2B-9F6485130126_=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57700) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dfD81-0000dl-2w for emacs-orgmode@gnu.org; Tue, 08 Aug 2017 18:37:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dfD7z-0004wq-US for emacs-orgmode@gnu.org; Tue, 08 Aug 2017 18:37:33 -0400 Received: from mail-pf0-x234.google.com ([2607:f8b0:400e:c00::234]:34223) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dfD7z-0004wM-LD for emacs-orgmode@gnu.org; Tue, 08 Aug 2017 18:37:31 -0400 Received: by mail-pf0-x234.google.com with SMTP id o86so19999076pfj.1 for ; Tue, 08 Aug 2017 15:37:29 -0700 (PDT) Received: from [192.168.0.107] ([2601:600:c200:ccb6:bcd7:a5ff:e45a:11f]) by smtp.gmail.com with ESMTPSA id p9sm4035875pgn.87.2017.08.08.15.37.27 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Aug 2017 15:37:27 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org --=_MailMate_2B7521A0-DBC5-4BD1-9F2B-9F6485130126_= Content-Type: text/plain; format=flowed 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 --=_MailMate_2B7521A0-DBC5-4BD1-9F2B-9F6485130126_= Content-Disposition: attachment; filename=0001-test-org.el-Fix-two-false-test-failures.patch Content-Transfer-Encoding: quoted-printable =46rom 8839e982b2177bd740ef3a88f6a999a30fd62698 Mon Sep 17 00:00:00 2001 From: Galen Menzel 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" ;; 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 --=_MailMate_2B7521A0-DBC5-4BD1-9F2B-9F6485130126_=--