org-clock: Re-activate tests

* testing/lisp/test-org-clock.el (test-org-clock/clocktable/ranges):
(test-org-clock/clocktable/step): Un-comment tests.

They were commented out in "org-clock.el: New option :tags to insert
tags in clock reports".
This commit is contained in:
Nicolas Goaziou 2018-04-29 00:22:53 +02:00
parent f77f5b963d
commit ba5bedc17f
1 changed files with 175 additions and 175 deletions

View File

@ -273,54 +273,54 @@ the buffer."
;;; Clocktable ;;; Clocktable
;; (ert-deftest test-org-clock/clocktable/ranges () (ert-deftest test-org-clock/clocktable/ranges ()
;; "Test ranges in Clock table." "Test ranges in Clock table."
;; ;; Relative time: Previous two days. ;; Relative time: Previous two days.
;; (should (should
;; (equal (equal
;; "| Headline | Time | | "| Headline | Time | |
;; |------------------------------+--------+------| |------------------------------+--------+------|
;; | *Total time* | *8:00* | | | *Total time* | *8:00* | |
;; |------------------------------+--------+------| |------------------------------+--------+------|
;; | Relative times in clocktable | 8:00 | | | Relative times in clocktable | 8:00 | |
;; | Foo | | 8:00 |" | Foo | | 8:00 |"
;; (org-test-with-temp-text (org-test-with-temp-text
;; "* Relative times in clocktable\n** Foo\n<point>" "* Relative times in clocktable\n** Foo\n<point>"
;; (insert (org-test-clock-create-clock "-3d 8:00" "-3d 12:00")) (insert (org-test-clock-create-clock "-3d 8:00" "-3d 12:00"))
;; (insert (org-test-clock-create-clock "-2d 15:00" "-2d 18:00")) (insert (org-test-clock-create-clock "-2d 15:00" "-2d 18:00"))
;; (insert (org-test-clock-create-clock "-1d 8:00" "-1d 13:00")) (insert (org-test-clock-create-clock "-1d 8:00" "-1d 13:00"))
;; (test-org-clock-clocktable-contents (test-org-clock-clocktable-contents
;; ":tstart \"<-2d>\" :tend \"<today>\" :indent nil")))) ":tstart \"<-2d>\" :tend \"<today>\" :indent nil"))))
;; ;; Relative time: Yesterday until now. ;; Relative time: Yesterday until now.
;; (should (should
;; (equal (equal
;; "| Headline | Time | | "| Headline | Time | |
;; |------------------------------+--------+------| |------------------------------+--------+------|
;; | *Total time* | *6:00* | | | *Total time* | *6:00* | |
;; |------------------------------+--------+------| |------------------------------+--------+------|
;; | Relative times in clocktable | 6:00 | | | Relative times in clocktable | 6:00 | |
;; | Foo | | 6:00 |" | Foo | | 6:00 |"
;; (org-test-with-temp-text (org-test-with-temp-text
;; "* Relative times in clocktable\n** Foo\n<point>" "* Relative times in clocktable\n** Foo\n<point>"
;; (insert (org-test-clock-create-clock "-2d 15:00" "-2d 18:00")) (insert (org-test-clock-create-clock "-2d 15:00" "-2d 18:00"))
;; (insert (org-test-clock-create-clock "-1d 8:00" "-1d 13:00")) (insert (org-test-clock-create-clock "-1d 8:00" "-1d 13:00"))
;; (insert (org-test-clock-create-clock ". 1:00" ". 2:00")) (insert (org-test-clock-create-clock ". 1:00" ". 2:00"))
;; (test-org-clock-clocktable-contents (test-org-clock-clocktable-contents
;; ":tstart \"<yesterday>\" :tend \"<tomorrow>\" :indent nil")))) ":tstart \"<yesterday>\" :tend \"<tomorrow>\" :indent nil"))))
;; ;; Test `untilnow' block. ;; Test `untilnow' block.
;; (should (should
;; (equal (equal
;; "| Headline | Time | | "| Headline | Time | |
;; |------------------------------+--------+------| |------------------------------+--------+------|
;; | *Total time* | *6:00* | | | *Total time* | *6:00* | |
;; |------------------------------+--------+------| |------------------------------+--------+------|
;; | Relative times in clocktable | 6:00 | | | Relative times in clocktable | 6:00 | |
;; | Foo | | 6:00 |" | Foo | | 6:00 |"
;; (org-test-with-temp-text (org-test-with-temp-text
;; "* Relative times in clocktable\n** Foo\n<point>" "* Relative times in clocktable\n** Foo\n<point>"
;; (insert (org-test-clock-create-clock "-10y 15:00" "-10y 18:00")) (insert (org-test-clock-create-clock "-10y 15:00" "-10y 18:00"))
;; (insert (org-test-clock-create-clock "-2d 15:00" "-2d 18:00")) (insert (org-test-clock-create-clock "-2d 15:00" "-2d 18:00"))
;; (test-org-clock-clocktable-contents ":block untilnow :indent nil"))))) (test-org-clock-clocktable-contents ":block untilnow :indent nil")))))
(ert-deftest test-org-clock/clocktable/match () (ert-deftest test-org-clock/clocktable/match ()
"Test \":match\" parameter in Clock table." "Test \":match\" parameter in Clock table."
@ -843,141 +843,141 @@ CLOCK: [2016-12-28 Wed 11:09]--[2016-12-28 Wed 11:09] => 0:00
CLOCK: [2016-12-28 Wed 13:09]--[2016-12-28 Wed 13:09] => 0:00" CLOCK: [2016-12-28 Wed 13:09]--[2016-12-28 Wed 13:09] => 0:00"
(test-org-clock-clocktable-contents ":tcolumns 2"))))) (test-org-clock-clocktable-contents ":tcolumns 2")))))
;; (ert-deftest test-org-clock/clocktable/step () (ert-deftest test-org-clock/clocktable/step ()
;; "Test \":step\" parameter in Clock table." "Test \":step\" parameter in Clock table."
;; ;; Regression test: week crossing month boundary before :wstart ;; Regression test: week crossing month boundary before :wstart
;; ;; day-of-week. ;; day-of-week.
;; (should (should
;; (equal " (equal "
;; Weekly report starting on: [2017-09-25 Mon] Weekly report starting on: [2017-09-25 Mon]
;; | Headline | Time | | Headline | Time |
;; |--------------+--------| |--------------+--------|
;; | *Total time* | *1:00* | | *Total time* | *1:00* |
;; |--------------+--------| |--------------+--------|
;; | Foo | 1:00 |" | Foo | 1:00 |"
;; (org-test-with-temp-text (org-test-with-temp-text
;; "* Foo "* Foo
;; CLOCK: [2017-09-30 Sat 12:00]--[2017-09-30 Sat 13:00] => 1:00 CLOCK: [2017-09-30 Sat 12:00]--[2017-09-30 Sat 13:00] => 1:00
;; CLOCK: [2017-10-01 Sun 11:00]--[2017-10-01 Sun 13:00] => 2:00 CLOCK: [2017-10-01 Sun 11:00]--[2017-10-01 Sun 13:00] => 2:00
;; CLOCK: [2017-10-02 Mon 11:00]--[2017-10-02 Mon 14:00] => 3:00" CLOCK: [2017-10-02 Mon 11:00]--[2017-10-02 Mon 14:00] => 3:00"
;; (let ((system-time-locale "en_US")) (let ((system-time-locale "en_US"))
;; (test-org-clock-clocktable-contents (test-org-clock-clocktable-contents
;; ":step week :block 2017-09 :stepskip0 t"))))) ":step week :block 2017-09 :stepskip0 t")))))
;; (should (should
;; (equal " (equal "
;; Weekly report starting on: [2017-10-01 Sun] Weekly report starting on: [2017-10-01 Sun]
;; | Headline | Time | | Headline | Time |
;; |--------------+--------| |--------------+--------|
;; | *Total time* | *2:00* | | *Total time* | *2:00* |
;; |--------------+--------| |--------------+--------|
;; | Foo | 2:00 | | Foo | 2:00 |
;; Weekly report starting on: [2017-10-02 Mon] Weekly report starting on: [2017-10-02 Mon]
;; | Headline | Time | | Headline | Time |
;; |--------------+--------| |--------------+--------|
;; | *Total time* | *7:00* | | *Total time* | *7:00* |
;; |--------------+--------| |--------------+--------|
;; | Foo | 7:00 | | Foo | 7:00 |
;; Weekly report starting on: [2017-10-09 Mon] Weekly report starting on: [2017-10-09 Mon]
;; | Headline | Time | | Headline | Time |
;; |--------------+--------| |--------------+--------|
;; | *Total time* | *5:00* | | *Total time* | *5:00* |
;; |--------------+--------| |--------------+--------|
;; | Foo | 5:00 | | Foo | 5:00 |
;; " "
;; (org-test-with-temp-text (org-test-with-temp-text
;; "* Foo "* Foo
;; CLOCK: [2017-09-30 Sat 12:00]--[2017-09-30 Sat 13:00] => 1:00 CLOCK: [2017-09-30 Sat 12:00]--[2017-09-30 Sat 13:00] => 1:00
;; CLOCK: [2017-10-01 Sun 11:00]--[2017-10-01 Sun 13:00] => 2:00 CLOCK: [2017-10-01 Sun 11:00]--[2017-10-01 Sun 13:00] => 2:00
;; CLOCK: [2017-10-02 Mon 11:00]--[2017-10-02 Mon 14:00] => 3:00 CLOCK: [2017-10-02 Mon 11:00]--[2017-10-02 Mon 14:00] => 3:00
;; CLOCK: [2017-10-08 Sun 09:00]--[2017-10-08 Sun 13:00] => 4:00 CLOCK: [2017-10-08 Sun 09:00]--[2017-10-08 Sun 13:00] => 4:00
;; CLOCK: [2017-10-09 Mon 09:00]--[2017-10-09 Mon 14:00] => 5:00" CLOCK: [2017-10-09 Mon 09:00]--[2017-10-09 Mon 14:00] => 5:00"
;; (let ((system-time-locale "en_US")) (let ((system-time-locale "en_US"))
;; (test-org-clock-clocktable-contents (test-org-clock-clocktable-contents
;; ":step week :block 2017-10 :stepskip0 t"))))) ":step week :block 2017-10 :stepskip0 t")))))
;; ;; :step day ;; :step day
;; (should (should
;; (equal " (equal "
;; Daily report: [2017-10-02 Mon] Daily report: [2017-10-02 Mon]
;; | Headline | Time | | Headline | Time |
;; |--------------+--------| |--------------+--------|
;; | *Total time* | *3:00* | | *Total time* | *3:00* |
;; |--------------+--------| |--------------+--------|
;; | Foo | 3:00 | | Foo | 3:00 |
;; Daily report: [2017-10-03 Tue] Daily report: [2017-10-03 Tue]
;; | Headline | Time | | Headline | Time |
;; |--------------+--------| |--------------+--------|
;; | *Total time* | *0:00* | | *Total time* | *0:00* |
;; Daily report: [2017-10-04 Wed] Daily report: [2017-10-04 Wed]
;; | Headline | Time | | Headline | Time |
;; |--------------+--------| |--------------+--------|
;; | *Total time* | *0:00* | | *Total time* | *0:00* |
;; Daily report: [2017-10-05 Thu] Daily report: [2017-10-05 Thu]
;; | Headline | Time | | Headline | Time |
;; |--------------+--------| |--------------+--------|
;; | *Total time* | *0:00* | | *Total time* | *0:00* |
;; Daily report: [2017-10-06 Fri] Daily report: [2017-10-06 Fri]
;; | Headline | Time | | Headline | Time |
;; |--------------+--------| |--------------+--------|
;; | *Total time* | *0:00* | | *Total time* | *0:00* |
;; Daily report: [2017-10-07 Sat] Daily report: [2017-10-07 Sat]
;; | Headline | Time | | Headline | Time |
;; |--------------+--------| |--------------+--------|
;; | *Total time* | *0:00* | | *Total time* | *0:00* |
;; Daily report: [2017-10-08 Sun] Daily report: [2017-10-08 Sun]
;; | Headline | Time | | Headline | Time |
;; |--------------+--------| |--------------+--------|
;; | *Total time* | *4:00* | | *Total time* | *4:00* |
;; |--------------+--------| |--------------+--------|
;; | Foo | 4:00 |" | Foo | 4:00 |"
;; (org-test-with-temp-text (org-test-with-temp-text
;; "* Foo "* Foo
;; CLOCK: [2017-09-30 Sat 12:00]--[2017-09-30 Sat 13:00] => 1:00 CLOCK: [2017-09-30 Sat 12:00]--[2017-09-30 Sat 13:00] => 1:00
;; CLOCK: [2017-10-01 Sun 11:00]--[2017-10-01 Sun 13:00] => 2:00 CLOCK: [2017-10-01 Sun 11:00]--[2017-10-01 Sun 13:00] => 2:00
;; CLOCK: [2017-10-02 Mon 11:00]--[2017-10-02 Mon 14:00] => 3:00 CLOCK: [2017-10-02 Mon 11:00]--[2017-10-02 Mon 14:00] => 3:00
;; CLOCK: [2017-10-08 Sun 09:00]--[2017-10-08 Sun 13:00] => 4:00 CLOCK: [2017-10-08 Sun 09:00]--[2017-10-08 Sun 13:00] => 4:00
;; CLOCK: [2017-10-09 Mon 09:00]--[2017-10-09 Mon 14:00] => 5:00" CLOCK: [2017-10-09 Mon 09:00]--[2017-10-09 Mon 14:00] => 5:00"
;; (let ((system-time-locale "en_US")) (let ((system-time-locale "en_US"))
;; (test-org-clock-clocktable-contents (test-org-clock-clocktable-contents
;; ":step day :block 2017-W40"))))) ":step day :block 2017-W40")))))
;; ;; Regression test: take :tstart and :tend hours into consideration. ;; Regression test: take :tstart and :tend hours into consideration.
;; (should (should
;; (equal " (equal "
;; Weekly report starting on: [2017-12-25 Mon] Weekly report starting on: [2017-12-25 Mon]
;; | Headline | Time | | Headline | Time |
;; |--------------+--------| |--------------+--------|
;; | *Total time* | *8:00* | | *Total time* | *8:00* |
;; |--------------+--------| |--------------+--------|
;; | Foo | 8:00 |" | Foo | 8:00 |"
;; (org-test-with-temp-text (org-test-with-temp-text
;; "* Foo "* Foo
;; CLOCK: [2017-12-27 Wed 08:00]--[2017-12-27 Wed 16:00] => 8:00" CLOCK: [2017-12-27 Wed 08:00]--[2017-12-27 Wed 16:00] => 8:00"
;; (let ((system-time-locale "en_US")) (let ((system-time-locale "en_US"))
;; (test-org-clock-clocktable-contents (test-org-clock-clocktable-contents
;; (concat ":step week :tstart \"<2017-12-25 Mon>\" " (concat ":step week :tstart \"<2017-12-25 Mon>\" "
;; ":tend \"<2017-12-27 Wed 23:59>\"")))))) ":tend \"<2017-12-27 Wed 23:59>\""))))))
;; (should (should
;; (equal " (equal "
;; Daily report: [2017-12-27 Wed] Daily report: [2017-12-27 Wed]
;; | Headline | Time | | Headline | Time |
;; |--------------+--------| |--------------+--------|
;; | *Total time* | *8:00* | | *Total time* | *8:00* |
;; |--------------+--------| |--------------+--------|
;; | Foo | 8:00 |" | Foo | 8:00 |"
;; (org-test-with-temp-text (org-test-with-temp-text
;; "* Foo "* Foo
;; CLOCK: [2017-12-27 Wed 08:00]--[2017-12-27 Wed 16:00] => 8:00" CLOCK: [2017-12-27 Wed 08:00]--[2017-12-27 Wed 16:00] => 8:00"
;; (let ((system-time-locale "en_US")) (let ((system-time-locale "en_US"))
;; (test-org-clock-clocktable-contents (test-org-clock-clocktable-contents
;; (concat ":step day :tstart \"<2017-12-25 Mon>\" " (concat ":step day :tstart \"<2017-12-25 Mon>\" "
;; ":tend \"<2017-12-27 Wed 23:59>\" :stepskip0 t"))))))) ":tend \"<2017-12-27 Wed 23:59>\" :stepskip0 t")))))))
(provide 'test-org-clock) (provide 'test-org-clock)
;;; test-org-clock.el end here ;;; test-org-clock.el end here