emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* test-org-colview.el: Fix an expected result in test-org-colview/columns-summary
@ 2017-06-13 13:36 hunglun o
  2017-06-14  9:42 ` Nicolas Goaziou
  0 siblings, 1 reply; 2+ messages in thread
From: hunglun o @ 2017-06-13 13:36 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 528 bytes --]

Hi,
some tests in test-org-colviews.el fail. If this patch is acceptable, I
will send more to fix the other failed test cases.

Let me know if I understand the test intent of this failed test case
correctly. Below is a summary from my patch:

* lisp/test-org-colview.el (test-org-colview/columns-summary): Fix 23rd
test case

This test sets 2014-03-04 to be current-time and then computes the
number of days between current-time and 2012-03-29. 705 days should be
expected. However, 705d 1h is given in the test case.


Thanks.

[-- Attachment #1.2: Type: text/html, Size: 703 bytes --]

[-- Attachment #2: 0001-test-org-colview.el-Fix-an-expected-result-in-test-o.patch --]
[-- Type: application/octet-stream, Size: 1100 bytes --]

From ea58796756f84a7c735d07598d785a365210f327 Mon Sep 17 00:00:00 2001
From: Hung Lun <hunglun.o@gmail.com>
Date: Tue, 13 Jun 2017 21:21:16 +0800
Subject: [PATCH] test-org-colview.el: Fix an expected result in
 test-org-colview/columns-summary

* lisp/test-org-colview.el (test-org-colview/columns-summary): Fix 23rd test case

This test sets 2014-03-04 to be current-time and then compute the
number of days between current-time and 2012-03-29. 705 days should be
expected. However, 705d 1h is given in the test case.

Modified from a patch proposal by O Hung Lun.

TINYCHANGE
---
 testing/lisp/test-org-colview.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testing/lisp/test-org-colview.el b/testing/lisp/test-org-colview.el
index f816e7b75..65f154530 100644
--- a/testing/lisp/test-org-colview.el
+++ b/testing/lisp/test-org-colview.el
@@ -528,7 +528,7 @@
 	(get-char-property (point) 'org-columns-value-modified)))))
   (should
    (equal
-    "705d 1h"
+    "705d"
     (cl-letf (((symbol-function 'current-time)
 	       (lambda ()
 		 (apply #'encode-time
-- 
2.12.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: test-org-colview.el: Fix an expected result in test-org-colview/columns-summary
  2017-06-13 13:36 test-org-colview.el: Fix an expected result in test-org-colview/columns-summary hunglun o
@ 2017-06-14  9:42 ` Nicolas Goaziou
  0 siblings, 0 replies; 2+ messages in thread
From: Nicolas Goaziou @ 2017-06-14  9:42 UTC (permalink / raw)
  To: hunglun o; +Cc: emacs-orgmode

Hello,

hunglun o <hunglun.o@googlemail.com> writes:

> This test sets 2014-03-04 to be current-time and then computes the
> number of days between current-time and 2012-03-29. 705 days should be
> expected. However, 705d 1h is given in the test case.

This is a bit more complicated.

The "1h" comes from daylight saving time, which your time zone probably
ignores. So applying your fix solve your issue and break it elsewhere.

I add an optional ZONE argument to `org-parse-time-string' to solve
this. Unfortunately, ZONE is not supported by `decode-time' in Emacs 24.
So, at the moment, `org-parse-time-string' is slightly broken on older
Emacsen.

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-06-14  9:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-13 13:36 test-org-colview.el: Fix an expected result in test-org-colview/columns-summary hunglun o
2017-06-14  9:42 ` Nicolas Goaziou

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).