From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id iLsAJTSWW2Z73gAAe85BDQ:P1 (envelope-from ) for ; Sat, 01 Jun 2024 23:44:20 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id iLsAJTSWW2Z73gAAe85BDQ (envelope-from ) for ; Sat, 01 Jun 2024 23:44:20 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=kyleam.com header.s=key1 header.b="wY/3fIkG"; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1717278260; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=VyP71hGvB+c+qgLmWx530LrxCCFTmuHi7Zk27OZqf/g=; b=aD2Imw5M96iCB9T4DFPskjI9SjZ7HMDuVXIfyfwYMyhMlUwYFRJ9AR8gmgk8mQ13jvsK+J FZPTVU3gLthzNB2DQXfeOEiSPph4nye+H5bcuzcKoUmPR4uXHTa2wmym0toLriD8xRjlDf 0rE3MeZ6WOKRSPTjn8FynGtI706o3rqz3lLvbGP3O8dkSf0HJ/wlA12UcFMcbA5NtKe9jI lGQdS3IFD1y/SeuOSR+8FNUckOnOSvEI2lUQMSEYoEpMcscCtU3kuYTxV849E2KfkqhoNG UHOnytgIOSX/GG42h4aU/aQLRpigZenE/+7f19bdu0BlTB7UhZMg5r8gFIJ87g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=kyleam.com header.s=key1 header.b="wY/3fIkG"; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Seal: i=1; s=key1; d=yhetil.org; t=1717278260; a=rsa-sha256; cv=none; b=I7oAoAABlOebaDdqSH9+Koe9YQ789WxCWqe1aOZSIOsnhh6YBaS7rYSqNQdzru3ak3E19T ak7mn4OqiPYYaqkJBqi8v8bjmi5EaCfDyx5P5iUwTiHlbQVZh87G70EAGRMCOFtVYuPVmh LFomO1H2p7UzxkcUfzuoEorCYJ/zAuCo3DTaOuLyALaL/q2oPiMz30KRWCWR3pCe/Y0Xnr VQQSxALlas/LzfuTJ8eu7dtALoJ9T73ebno07p/9Ldw/6YLEUl0ZQC1xXWZ6RXrpqhNzMa hNODCh2H8HDjB9+TtuBQHtP3fgIYe9gvfQ5wU2G59uTJIfg+LxFOnevLohIjOQ== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 0D5D56C927 for ; Sat, 1 Jun 2024 23:44:19 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sDWVa-0008O9-5t; Sat, 01 Jun 2024 17:43:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sDWVZ-0008O1-Gj for emacs-orgmode@gnu.org; Sat, 01 Jun 2024 17:43:25 -0400 Received: from out-175.mta0.migadu.com ([2001:41d0:1004:224b::af]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sDWVX-00066k-D2 for emacs-orgmode@gnu.org; Sat, 01 Jun 2024 17:43:25 -0400 X-Envelope-To: emacs-orgmode@gnu.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kyleam.com; s=key1; t=1717278196; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VyP71hGvB+c+qgLmWx530LrxCCFTmuHi7Zk27OZqf/g=; b=wY/3fIkGTixum6K6iTq1Sj9dHwkirJlixGLf6ppRM/pJOdO1goIdp0OViG9xR/KLtJxHNB +oORx1zTx+KWvS52T6WDin+lTv57mTbUYgcw00GymBeJVpr/JO4YTRCnrbf0KXYjv4dTF6 GExMNN8CNJI82VNpbZTbVaSpQ4YTU4QhWryRP2iC+7WzBowOyB9qJ1d6RCEp+e3OyV5ajA GJCbZPPfl7o1lpzJAHQPCiuJLwkBhBUQX/Bl+u6X2deQYOiTKIxoFozzAupd+CrFBwCoMS Gvu+fIBqUkqr3YAplbwbEnNrGCOEN8GS6yVKxNUD1sbIOuwvt4R6/ZOqPVXdSA== X-Envelope-To: ruijie@netyu.xyz X-Envelope-To: yantar92@posteo.net X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kyle Meyer To: emacs-orgmode@gnu.org Cc: ruijie@netyu.xyz, yantar92@posteo.net Subject: [PATCH] org-test: Fix zone-dependent miscalculation of days of week Date: Sat, 01 Jun 2024 17:43:11 -0400 Message-ID: <87le3o5ogg.fsf@kyleam.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2001:41d0:1004:224b::af; envelope-from=kyle@kyleam.com; helo=out-175.mta0.migadu.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Spam-Score: -7.04 X-Migadu-Queue-Id: 0D5D56C927 X-Migadu-Scanner: mx10.migadu.com X-Migadu-Spam-Score: -7.04 X-TUID: J3TEaPChPwjB Hello, Three clock tests are failing on my end: FAILED test-org-clock/clock-drawer-dwim (... :explanation (array-elt 35 (different-atoms (87 "#x57" "?W") (84 "#x54" "?T")))) FAILED test-org-clock/org-clock-timestamps-change (... :explanation (array-elt 20 (different-atoms (97 "#x61" "?a") (117 "#x75" "?u")))) FAILED test-org-clok/org-clock-update-time-maybe (... :explanation (array-elt 19 (different-atoms (70 "#x46" "?F") (83 "#x53" "?S")))) Those stem from org-test-day-of-weeks-{abbrev,full} not having the expected value. Those variables are supposed to list Sunday through Saturday in the machine's locale. Here's what I see on my end: org-test-day-of-weeks-full=E2=80=99s value is ["Saturday" "Monday" "Monday" "Tuesday" "Wednesday" "Thursday" "Friday"] The patch below fixes the issue on my end. In addition to my usual locale, I tested it with another one (de_BE.utf8), and all the tests passed. -- >8 -- Subject: [PATCH] org-test: Fix zone-dependent miscalculation of days of week * testing/org-test.el (org-test-day-of-weeks-seconds): Specify seconds for formatting with UTC as time zone. (org-test-day-of-weeks-abbrev): (org-test-day-of-weeks-full): Use UTC as time zone when formatting input. Avoid calling format-time-string with the local time zone because that gives the wrong result in some cases. For example, 2222222 is supposed to produce the locale's name for "Tuesday" but, when the local time zone is +0000, (format-time-string "%A" 2222222) returns the locale's name for "Monday". --- testing/org-test.el | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/testing/org-test.el b/testing/org-test.el index d9fe33284..643c5c766 100644 --- a/testing/org-test.el +++ b/testing/org-test.el @@ -549,26 +549,26 @@ (defmacro org-test-capture-warnings (&rest body) (nreverse messages))) =20 (defconst org-test-day-of-weeks-seconds - [121223891 ; Sun - 30000000 ; Mon - 2222222 ; Tue - 500000 ; Wed - 1000 ; Thu - 89173 ; Fri - 666666666] ; Sat + [302400 ; Sun + 388800 ; Mon + 475200 ; Tue + 561600 ; Wed + 648000 ; Thu + 734400 ; Fri + 820800] ; Sat "Epoch seconds for generating days of week strings. Starts at Sunday, ends at Saturday.") =20 (defconst org-test-day-of-weeks-abbrev (apply #'vector - (seq-map (apply-partially #'format-time-string "%a") + (seq-map (lambda (s) (format-time-string "%a" s t)) org-test-day-of-weeks-seconds)) "Vector of abbreviated names of days of week. See `org-test-day-of-weeks-seconds'.") =20 (defconst org-test-day-of-weeks-full (apply #'vector - (seq-map (apply-partially #'format-time-string "%A") + (seq-map (lambda (s) (format-time-string "%A" s t)) org-test-day-of-weeks-seconds)) "Vector of full names for days of week. See `org-test-day-of-weeks-seconds'.") base-commit: 671ca44df04801514fd77faf06e7e0b3216188a6 --=20 2.41.0