From edfb11b1a161d39a3f88279bc7b395aa8e6f68b7 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sun, 15 Feb 2026 21:14:18 -0600 Subject: test: add 38 tests for org-agenda-config and org-refile-config - testutil-org.el: shared dynamic timestamp helpers (days-ago, days-ahead, today) - org-agenda-config: 31 tests across 2 files (skip functions + add-files) - org-refile-config: 7 tests for ensure-org-mode validation - Remove prog-shell from checklist (fully covered by existing 9 tests) --- tests/testutil-org.el | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 tests/testutil-org.el (limited to 'tests/testutil-org.el') diff --git a/tests/testutil-org.el b/tests/testutil-org.el new file mode 100644 index 00000000..c1949981 --- /dev/null +++ b/tests/testutil-org.el @@ -0,0 +1,32 @@ +;;; testutil-org.el --- Test utilities for org-mode tests -*- lexical-binding: t; -*- +;; +;; Author: Craig Jennings +;; +;;; Commentary: +;; Utilities for testing org-mode related modules. +;; Provides dynamic timestamp generation for deterministic date-sensitive tests. +;; No hardcoded dates — all timestamps generated relative to current time. +;; +;; See also: testutil-calendar-sync.el for iCal-specific timestamp utilities. + +;;; Code: + +(defun test-org-timestamp-days-ago (days) + "Generate org timestamp string for DAYS ago. +Returns string like \"<2026-02-10 Tue>\"." + (format-time-string "<%Y-%m-%d %a>" + (time-subtract (current-time) (* days 86400)))) + +(defun test-org-timestamp-days-ahead (days) + "Generate org timestamp string for DAYS from now. +Returns string like \"<2026-02-20 Fri>\"." + (format-time-string "<%Y-%m-%d %a>" + (time-add (current-time) (* days 86400)))) + +(defun test-org-timestamp-today () + "Generate org timestamp string for today. +Returns string like \"<2026-02-15 Sun>\"." + (format-time-string "<%Y-%m-%d %a>")) + +(provide 'testutil-org) +;;; testutil-org.el ends here -- cgit v1.2.3