mirror of
https://github.com/correl/org-habit-streaks.git
synced 2024-11-23 19:19:54 +00:00
15 lines
471 B
EmacsLisp
15 lines
471 B
EmacsLisp
|
(defun count-streaks (interval values)
|
||
|
(-map #'length (org-habit-streaks--streaks interval values)))
|
||
|
|
||
|
(ert-deftest count-streaks-empty ()
|
||
|
(should (equal (count-streaks 1 nil) nil)))
|
||
|
|
||
|
(ert-deftest count-streaks-single-entry ()
|
||
|
(should (equal (count-streaks 1 '(1)) '(1))))
|
||
|
|
||
|
(ert-deftest count-streaks-long-streak ()
|
||
|
(should (equal (count-streaks 1 '(1 2 3)) '(3))))
|
||
|
|
||
|
(ert-deftest count-streaks-multiple ()
|
||
|
(should (equal (count-streaks 1 '(1 2 4 5 6)) '(3 2))))
|