From fe9f2b494f7f78a21b54d43f2546a6da5818b3d3 Mon Sep 17 00:00:00 2001 From: contrapunctus Date: Thu, 13 Jan 2022 22:45:03 +0530 Subject: [PATCH] Add links to tests --- elisp/chronometrist.org | 8 ++++++++ tests/chronometrist-tests.org | 12 ++++++++++++ 2 files changed, 20 insertions(+) diff --git a/elisp/chronometrist.org b/elisp/chronometrist.org index ff1efef..06c0d93 100644 --- a/elisp/chronometrist.org +++ b/elisp/chronometrist.org @@ -610,6 +610,8 @@ TS must be a ts struct (see `ts.el')." #+END_SRC *** plist-p :function: +[[file:../tests/chronometrist-tests.org::#tests-common-plist-p][tests]] + #+BEGIN_SRC emacs-lisp (defun chronometrist-plist-p (list) "Return non-nil if LIST is a property list, i.e. (:KEYWORD VALUE ...)" @@ -652,6 +654,8 @@ Return new position of point." #+END_SRC *** current-task :reader:method: +[[file:../tests/chronometrist-tests.org::#tests-common-current-task][tests]] + #+BEGIN_SRC emacs-lisp (cl-defun chronometrist-current-task (&optional (backend (chronometrist-active-backend))) "Return the name of the active task as a string, or nil if not clocked in." @@ -1481,6 +1485,8 @@ a user.") **** file operations ***** create-file :generic:function: +[[file:../tests/chronometrist-tests.org::#tests-backend-create-file][tests]] + #+BEGIN_SRC emacs-lisp (cl-defgeneric chronometrist-create-file (backend &optional file) "Create file associated with BACKEND. @@ -2580,6 +2586,8 @@ Situations - #+END_SRC **** plists-split-p :function: +[[file:../tests/chronometrist-tests.org::#tests-common-plists-split-p][tests]] + #+BEGIN_SRC emacs-lisp (defun chronometrist-plists-split-p (old-plist new-plist) "Return t if OLD-PLIST and NEW-PLIST are split plists. diff --git a/tests/chronometrist-tests.org b/tests/chronometrist-tests.org index 0bfdd22..308497f 100644 --- a/tests/chronometrist-tests.org +++ b/tests/chronometrist-tests.org @@ -147,6 +147,9 @@ BACKEND-VAR is bound to each backend in * Tests ** common *** current-task +:PROPERTIES: +:CUSTOM_ID: tests-common-current-task +:END: #+BEGIN_SRC emacs-lisp (chronometrist-ert-deftest current-task b ;; (message "current-task test - hash-table-count %s" (hash-table-count (chronometrist-backend-hash-table b))) @@ -159,6 +162,9 @@ BACKEND-VAR is bound to each backend in #+END_SRC *** plist-p +:PROPERTIES: +:CUSTOM_ID: tests-common-plist-p +:END: #+BEGIN_SRC emacs-lisp (ert-deftest chronometrist-plist-p () (should (eq t (chronometrist-plist-p '(:a 1 :b 2)))) @@ -168,6 +174,9 @@ BACKEND-VAR is bound to each backend in #+END_SRC *** plists-split-p +:PROPERTIES: +:CUSTOM_ID: tests-common-plists-split-p +:END: #+BEGIN_SRC emacs-lisp (ert-deftest chronometrist-plists-split-p () (should @@ -404,6 +413,9 @@ Tests to be added - The order of these tests is important - the last test for each case is one which moves into the next case. *** create-file +:PROPERTIES: +:CUSTOM_ID: tests-backend-create-file +:END: #+BEGIN_SRC emacs-lisp (chronometrist-ert-deftest create-file b ;; (message "create-file test - hash-table-count %s" (hash-table-count (chronometrist-backend-hash-table b)))