Morgan Smith <[email protected]> writes:

> Morgan Smith <[email protected]> writes:
>
>> note: "test-org-agenda/time-grid" currently fails interactivly as the value 
>> of
>> `org-agenda-time-grid' depends on `(display-graphic-p)' but that's an issue 
>> for
>> another day.
>
> Fixed it!  See attached.  Also see previous email for 2 more patches if
> you haven't already.
>
> Tested on emacs 28.2, emacs 29.4, and emacs 30.2

Oops, don't use that patch.  Used the patch attached to this email.

I apologize for the noise.  I am still new to using git worktree (the
subcommand) and stacked references.  I managed to update the git
references in the worktree (linked worktree) but not the working tree
(the directory contents).  Thanks git for naming two different things
"work tree".  Not at all confusing.

This patch actually was tested on emacs 28.2, emacs 29.4, and emacs
30.2 unlike my last one.

>From 6684da0355e433aef328f66e12fa59464faa6287 Mon Sep 17 00:00:00 2001
From: Morgan Smith <[email protected]>
Date: Fri, 17 Oct 2025 10:21:10 -0400
Subject: [PATCH] testing: Fix test failure on graphical frames

* testing/lisp/test-org-agenda.el (test-org-agenda/time-grid): Test
against `org-agenda-time-grid' and `org-agenda-current-time-string'
instead of a hardcoded string as they depend on `display-graphic-p'.
---
 testing/lisp/test-org-agenda.el | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/testing/lisp/test-org-agenda.el b/testing/lisp/test-org-agenda.el
index 1abc53028..46ae94229 100644
--- a/testing/lisp/test-org-agenda.el
+++ b/testing/lisp/test-org-agenda.el
@@ -99,7 +99,10 @@ test-org-agenda/time-grid
       (set-buffer org-agenda-buffer-name)
       (save-excursion
         (goto-char (point-min))
-        (should (search-forward "8:00...... now - - - - - - - - - - - - - - - - - - - - - - - - -")))
+        (should (search-forward
+                 (concat "8:00"
+                         (string-pad (nth 2 org-agenda-time-grid) 7)
+                         org-agenda-current-time-string))))
       (save-excursion
         (goto-char (point-min))
         (should (search-forward "agenda-file2: 9:30-10:00 Scheduled:  TODO one")))
@@ -108,13 +111,17 @@ test-org-agenda/time-grid
         (should (search-forward "agenda-file2:10:00-12:30 Scheduled:  TODO two")))
       (save-excursion
         (goto-char (point-min))
-        (should (search-forward "10:00...... ----------------")))
+        (should (search-forward (concat "10:00"
+                                        (string-pad (nth 2 org-agenda-time-grid) 7)
+                                        (nth 3 org-agenda-time-grid)))))
       (save-excursion
         (goto-char (point-min))
         (should (search-forward "agenda-file2:13:00-15:00 Scheduled:  TODO three")))
       (save-excursion
         (goto-char (point-min))
-        (should (search-forward "agenda-file2:19:00...... Scheduled:  TODO four"))))
+        (should (search-forward (concat "agenda-file2:19:00"
+                                        (string-pad (nth 2 org-agenda-time-grid) 7)
+                                        "Scheduled:  TODO four")))))
     (org-test-agenda--kill-all-agendas))
   ;; Custom time grid strings
   (org-test-at-time "2024-01-17 8:00"
-- 
2.51.0

Reply via email to