Add links to tests

This commit is contained in:
contrapunctus 2022-01-13 22:45:03 +05:30
parent 84069f0b87
commit fe9f2b494f
2 changed files with 20 additions and 0 deletions

View File

@ -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.

View File

@ -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)))