emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] testing/lisp/test-org-archive.el: Fix test
@ 2021-01-13 22:09 Christian Garbs via General discussions about Org-mode.
  2021-01-14  5:22 ` Kyle Meyer
  0 siblings, 1 reply; 2+ messages in thread
From: Christian Garbs via General discussions about Org-mode. @ 2021-01-13 22:09 UTC (permalink / raw)
  To: emacs-orgmode

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

Hello,

I've run across a test error on the current HEAD.
When I run "make test" on my system, then test-org-archive/datetree
fails.

The test fails because the expected output should contain "Sunday",
but with a German locale the generated text is "Sonntag" instead
(which is the German translation of "Sunday").

The attached patch fixed the test for me.

Best regards
Christian
-- 
....Christian.Garbs....................................https://www.cgarbs.de

Q:  What's a light-year?
A:  One-third less calories than a regular year.

[-- Attachment #2: 0001-testing-lisp-test-org-archive.el-Fix-test.patch --]
[-- Type: text/x-diff, Size: 2144 bytes --]

From 94055073ce79080be360070b86dcd5f2c074c9d3 Mon Sep 17 00:00:00 2001
From: Christian Garbs <mitch@cgarbs.de>
Date: Wed, 13 Jan 2021 22:57:21 +0100
Subject: [PATCH] testing/lisp/test-org-archive.el: Fix test

* testing/lisp/test-org-archive.el
(test-org-archive/datetree): Fix test for locales that don't use
English weekday names.
---
 testing/lisp/test-org-archive.el | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/testing/lisp/test-org-archive.el b/testing/lisp/test-org-archive.el
index 71ab427d2..d24a54794 100644
--- a/testing/lisp/test-org-archive.el
+++ b/testing/lisp/test-org-archive.el
@@ -63,7 +63,7 @@
     ;; Test in buffer target with no additional subheadings...
     (should
      (string-match-p
-      (regexp-quote "*** 2020-07-05 Sunday\n**** a")
+      (regexp-quote (format-time-string "*** 2020-07-05 %A\n**** a"))
       (org-test-with-temp-text-in-file "* a\n"
 	(let ((org-archive-location "::datetree/"))
 	  (org-archive-subtree)
@@ -71,7 +71,7 @@
     ;; ... and with `org-odd-levels-only' non-nil.
     (should
      (string-match-p
-      (regexp-quote "***** 2020-07-05 Sunday\n******* a")
+      (regexp-quote (format-time-string "***** 2020-07-05 %A\n******* a"))
       (org-test-with-temp-text-in-file "* a\n"
 	(let ((org-archive-location "::datetree/")
 	      (org-odd-levels-only t))
@@ -80,7 +80,7 @@
     ;; Test in buffer target with an additional subheading...
     (should
      (string-match-p
-      (regexp-quote "*** 2020-07-05 Sunday\n**** a\n***** b")
+      (regexp-quote (format-time-string "*** 2020-07-05 %A\n**** a\n***** b"))
       (org-test-with-temp-text-in-file "* b\n"
 	(let ((org-archive-location "::datetree/* a"))
 	  (org-archive-subtree)
@@ -88,7 +88,7 @@
     ;; ... and with `org-odd-levels-only' non-nil.
     (should
      (string-match-p
-      (regexp-quote "***** 2020-07-05 Sunday\n******* a\n********* b")
+      (regexp-quote (format-time-string "***** 2020-07-05 %A\n******* a\n********* b"))
       (org-test-with-temp-text-in-file "* b\n"
 	(let ((org-archive-location "::datetree/* a")
 	      (org-odd-levels-only t))
-- 
2.20.1


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

* Re: [PATCH] testing/lisp/test-org-archive.el: Fix test
  2021-01-13 22:09 [PATCH] testing/lisp/test-org-archive.el: Fix test Christian Garbs via General discussions about Org-mode.
@ 2021-01-14  5:22 ` Kyle Meyer
  0 siblings, 0 replies; 2+ messages in thread
From: Kyle Meyer @ 2021-01-14  5:22 UTC (permalink / raw)
  To: Christian Garbs; +Cc: emacs-orgmode

Christian Garbs via "General discussions about Org-mode." writes:

> Hello,
>
> I've run across a test error on the current HEAD.
> When I run "make test" on my system, then test-org-archive/datetree
> fails.
>
> The test fails because the expected output should contain "Sunday",
> but with a German locale the generated text is "Sonntag" instead
> (which is the German translation of "Sunday").

Ah, that was dumb on my part.

> Subject: [PATCH] testing/lisp/test-org-archive.el: Fix test
>
> * testing/lisp/test-org-archive.el
> (test-org-archive/datetree): Fix test for locales that don't use
> English weekday names.
> ---
>  testing/lisp/test-org-archive.el | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/testing/lisp/test-org-archive.el b/testing/lisp/test-org-archive.el
> index 71ab427d2..d24a54794 100644
> --- a/testing/lisp/test-org-archive.el
> +++ b/testing/lisp/test-org-archive.el
> @@ -63,7 +63,7 @@
>      ;; Test in buffer target with no additional subheadings...
>      (should
>       (string-match-p
> -      (regexp-quote "*** 2020-07-05 Sunday\n**** a")
> +      (regexp-quote (format-time-string "*** 2020-07-05 %A\n**** a"))

Works for me.  Another option would be to let-bind system-time-locale.

Applied (d02c0218e).  Thank you.


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

end of thread, other threads:[~2021-01-14  5:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-13 22:09 [PATCH] testing/lisp/test-org-archive.el: Fix test Christian Garbs via General discussions about Org-mode.
2021-01-14  5:22 ` Kyle Meyer

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