org-habit-streaks/test/org-habit-streaks-test.el
2015-06-11 18:16:32 -04:00

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