diff --git a/functions.org b/functions.org index 84b99d1..5653735 100644 --- a/functions.org +++ b/functions.org @@ -1,4 +1,4 @@ -* TODO Test coverage [5/44] +* TODO Test coverage [6/44] - [ ] timeclock-list-idle-timer () - [ ] timeclock-list-current-project () - [ ] timeclock-list-project-active? (project) @@ -7,7 +7,7 @@ - [ ] timeclock-list-project-at-point () - [ ] timeclock-list-goto-last-project () - [X] timeclock-list-time-add (a b) - - [ ] timeclock-list-total-time-one-day (&optional date) + - [X] timeclock-list-total-time-one-day (&optional date) - [ ] timeclock-list-print-non-tabular () - [ ] timeclock-list-toggle-project (&optional arg) - [ ] timeclock-list (&optional arg) diff --git a/timeclock-ui-tests.el b/timeclock-ui-tests.el index 56b92ce..acef7f7 100644 --- a/timeclock-ui-tests.el +++ b/timeclock-ui-tests.el @@ -246,6 +246,7 @@ [1 1 1]))) (ert-deftest timeclock-list-time-add-tests () + "Tests for `timeclock-list-time-add'." (should (equal (timeclock-list-time-add [0 0 0] [0 0 0]) [0 0 0])) (should (equal (timeclock-list-time-add [0 0 1] [0 0 0]) @@ -257,6 +258,20 @@ (should (equal (timeclock-list-time-add [0 1 1] [0 59 59]) [1 1 0]))) +(ert-deftest timeclock-list-ttod-tests () + "Tests for `timeclock-list-total-time-one-day'." + (let ((timeclock-file "test.timelog")) + (timeclock-reread-log) + (should (equal (timeclock-list-total-time-one-day '(0 0 0 1 1 2018)) + [5 0 0])) + (should (equal (timeclock-list-total-time-one-day '(0 0 0 2 1 2018)) + [1 0 0])) + (should (equal (timeclock-list-total-time-one-day '(0 0 0 3 1 2018)) + [1 0 0])))) + +;; (ert-deftest timeclock-report-iodd-tests () +;; (should (equal (timeclock-report-increment-or-decrement-date '(0 0 0 28 2 2020) '+)))) + (provide 'timeclock-ui-tests) ;; Local Variables: