Ruijie Yu via "General discussions about Org-mode." <emacs-orgmode@gnu.org> 
writes:

> Ruijie Yu via "General discussions about Org-mode." <emacs-orgmode@gnu.org> 
> writes:
>
>> Axel Kielhorn <org-m...@axelkielhorn.de> writes:
>>
>>> Hello!
>>>
>>> I’m building org with LANG=de.
>>> As a result I get two failed tests:
>>
>> Reproducible using "LANG=zh_CN.UTF-8".  In fact, I got more failed tests
>> in my testing.  I think the OP's two test failures are due to hardcoded
>> English expected result, whereas the additional test failures on my
>> testing are probably due to the fact that each Chinese character is as
>> wide as two latin letters, which catches some testing code offguard.
>>
>> Here are the test names that failed unexpectedly for me.  All the
>> "should"'s and "should-not"'s are in the attachment below.
>>
>> --8<---------------cut here---------------start------------->8---
>> 8 unexpected results:
>>    FAILED  test-org-clock/clock-drawer-dwim
>>    FAILED  test-org-clock/clocktable/lang
>>    FAILED  test-org-clok/org-clock-timestamps-change
>>    FAILED  test-org-colview/columns-width
>>    FAILED  test-org/add-planning-info
>>    FAILED  test-org/clone-with-time-shift
>>    FAILED  test-org/deadline
>>    FAILED  test-org/schedule
>> --8<---------------cut here---------------end--------------->8---
>>
>> [3. text/plain; lang.txt]...
>
> Update: interestingly, there is one test error when setting
> "LANG=en_US.UTF-8" or "LANG=C".
>
> [2. text/plain; lang-en-us-utf8.txt]...
>
>
> And, two somewhat different test errors when setting "LANG=fr_FR.UTF-8".
>
> [4. text/plain; lang-fr-fr-utf8.txt]...

Axel, does this patch fix test-org-clock/clock-drawer-dwim on your
system?

>From e223381ca670f99e6f6d69a7920923e2ad5ea91c Mon Sep 17 00:00:00 2001
From: Ruijie Yu <rui...@netyu.xyz>
Date: Sat, 22 Apr 2023 20:36:18 +0800
Subject: [PATCH] * testing/lisp/test-org-clock.el

Avoid hard-coded values where locales play a significant role.
---
 testing/lisp/test-org-clock.el | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/testing/lisp/test-org-clock.el b/testing/lisp/test-org-clock.el
index 7d8123e1f..3f587ce05 100644
--- a/testing/lisp/test-org-clock.el
+++ b/testing/lisp/test-org-clock.el
@@ -299,11 +299,12 @@ the buffer."
 
 (ert-deftest test-org-clock/clock-drawer-dwim ()
   "Test DWIM update of days for clocks in logbook drawers."
-  (should (equal "* Foo
+  (should (equal (let ((thu (format-time-string "%a" 1000)))
+                   (format "* Foo
 :LOGBOOK:
-CLOCK: [2022-11-03 Thu 06:00]--[2022-11-03 Thu 06:01] =>  0:01
+CLOCK: [2022-11-03 %s 06:00]--[2022-11-03 %s 06:01] =>  0:01
 :END:
-"
+" thu thu))
          (org-test-with-temp-text
              "* Foo
 :LOGBOOK:
-- 
2.40.0

-- 
Best,


RY

[Please note that this mail might go to spam due to some
misconfiguration in my mail server -- still investigating.]

Reply via email to