branch: externals/org
commit 5c6007aa092aa8b6126f4490e3991e3d3d982e69
Author: Morgan Smith <[email protected]>
Commit: Ihor Radchenko <[email protected]>
Testing: Add test for clocktable with :timestamp set
* testing/lisp/test-org-clock.el
(test-org-clock/clocktable/timestamp): New test.
---
testing/lisp/test-org-clock.el | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/testing/lisp/test-org-clock.el b/testing/lisp/test-org-clock.el
index 4806bdae8b..fe1ade01cc 100644
--- a/testing/lisp/test-org-clock.el
+++ b/testing/lisp/test-org-clock.el
@@ -480,6 +480,33 @@ Open clocks should be ignored unless it is clocked in and
(goto-line 4)
(test-org-clock-clocktable-contents ":tags t :indent nil")))))
+(ert-deftest test-org-clock/clocktable/timestamp ()
+ "Test \":timestamp\" parameter in Clock table."
+ (should
+ (equal
+ "| Timestamp | Headline | Time |
+|------------------------+--------------------+--------|
+| | *Total time* | *4:00* |
+|------------------------+--------------------+--------|
+| <2025-10-24 Fri 10:00> | scheduled | 1:00 |
+| <2025-10-24 Fri 10:00> | deadline | 1:00 |
+| <2025-10-24 Fri 10:00> | timestamp | 1:00 |
+| [2025-10-24 Fri 10:00] | inactive timestamp | 1:00 |"
+ (org-test-with-temp-text "* scheduled
+SCHEDULED: <2025-10-24 Fri 10:00>
+CLOCK: [2025-10-23 Thu 12:00]--[2025-10-23 Thu 13:00] => 1:00
+* deadline
+DEADLINE: <2025-10-24 Fri 10:00>
+CLOCK: [2025-10-23 Thu 12:00]--[2025-10-23 Thu 13:00] => 1:00
+* timestamp
+<2025-10-24 Fri 10:00>
+CLOCK: [2025-10-23 Thu 12:00]--[2025-10-23 Thu 13:00] => 1:00
+* inactive timestamp
+[2025-10-24 Fri 10:00]
+CLOCK: [2025-10-23 Thu 12:00]--[2025-10-23 Thu 13:00] => 1:00
+"
+ (test-org-clock-clocktable-contents ":timestamp t")))))
+
(ert-deftest test-org-clock/clocktable/scope ()
"Test \":scope\" parameter in Clock table."
;; Test `file-with-archives' scope. In particular, preserve "TBLFM"