emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals-release/org b99beaa 2/4: org-macs: Add basic tests for


From: ELPA Syncer
Subject: [elpa] externals-release/org b99beaa 2/4: org-macs: Add basic tests for org-matcher-time
Date: Sun, 24 Jan 2021 22:57:10 -0500 (EST)

branch: externals-release/org
commit b99beaad18f9ec02f626a39ebb1f87b55975b4d5
Author: Kyle Meyer <kyle@kyleam.com>
Commit: Kyle Meyer <kyle@kyleam.com>

    org-macs: Add basic tests for org-matcher-time
    
    * testing/lisp/test-org-macs.el (test-org-matcher-time): Add tests.
    
    This includes of a test for the missing hour modifier added in the
    previous commit.
---
 testing/lisp/test-org-macs.el | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/testing/lisp/test-org-macs.el b/testing/lisp/test-org-macs.el
index 7db17cc..efa992a 100644
--- a/testing/lisp/test-org-macs.el
+++ b/testing/lisp/test-org-macs.el
@@ -103,5 +103,34 @@
    (org-test-with-temp-text "xx abc<point> xx"
      (org-in-regexp "abc" nil t))))
 
+
+;;; Time
+
+(ert-deftest test-org-matcher-time ()
+  "Test `org-matcher-time'."
+  (let ((system-time-locale "en_US"))
+    (org-test-at-time "<2021-01-11 Mon 13:00>"
+      (should (equal (list 0 0 13 11 1 2021)
+                     (butlast (org-decode-time (org-matcher-time "<now>"))
+                              3)))
+      (should (equal (list 0 0 0 14 1 2021)
+                     (butlast (org-decode-time (org-matcher-time "<+3d>"))
+                              3)))
+      (should (equal (list 0 0 0 9 1 2021)
+                     (butlast (org-decode-time (org-matcher-time "<-2d>"))
+                              3)))
+      (should (equal (list 0 0 0 18 1 2021)
+                     (butlast (org-decode-time (org-matcher-time "<+1w>"))
+                              3)))
+      (should (equal (list 0 0 17 11 1 2021)
+                     (butlast (org-decode-time (org-matcher-time "<+4h>"))
+                              3)))
+      (should (equal (list 0 0 11 11 1 2021)
+                     (butlast (org-decode-time (org-matcher-time "<-2h>"))
+                              3)))
+      (should (equal (list 0 0 3 12 1 2021)
+                     (butlast (org-decode-time (org-matcher-time "<+14h>"))
+                              3))))))
+
 (provide 'test-org-macs)
 ;;; test-org-macs.el ends here



reply via email to

[Prev in Thread] Current Thread [Next in Thread]