emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Galen Menzel" <galen.menzel@utexas.edu>
To: emacs-orgmode@gnu.org
Subject: [PATCH] Fix two false failures in org's test suite
Date: Tue, 08 Aug 2017 15:37:26 -0700	[thread overview]
Message-ID: <F30743AD-0F32-46D4-AA0D-BB3391C1A9C6@utexas.edu> (raw)

[-- Attachment #1: Type: text/plain, Size: 614 bytes --]

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

[-- Attachment #2: 0001-test-org.el-Fix-two-false-test-failures.patch --]
[-- Type: text/plain, Size: 1628 bytes --]

From 8839e982b2177bd740ef3a88f6a999a30fd62698 Mon Sep 17 00:00:00 2001
From: Galen Menzel <galen.menzel@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	other threads:[~2017-08-08 22:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-08 22:37 Galen Menzel [this message]
2017-08-10 10:16 ` [PATCH] Fix two false failures in org's test suite Nicolas Goaziou
2017-08-10 17:58   ` Galen Menzel
2017-08-10 20:46     ` Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=F30743AD-0F32-46D4-AA0D-BB3391C1A9C6@utexas.edu \
    --to=galen.menzel@utexas.edu \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).