[Timeline] Add test for conflict resolution

This commit is contained in:
Daniel - 2019-02-16 19:45:47 +01:00
parent fa2fc56a0a
commit 18aab45d59
Signed by: dbo
GPG Key ID: 4F63DB96D45AA9C6
1 changed files with 34 additions and 0 deletions

View File

@ -101,3 +101,37 @@ CLOCK: [2018-01-08 Mon 16:00]--[2018-01-08 Mon 16:15] => 0:15
((1515334380.0 . 1515338220.0)
(1515423600.0 . 1515424500.0)))))))
(ert-deftest timeline-tools-test-clockline-no-conflict-1 ()
"Test `timeline-tools-clockline-no-conflict with complex example."
(with-temp-buffer
(insert "
* Task 1
:LOGBOOK:
CLOCK: [2018-01-07 Sun 13:15]--[2018-01-07 Sun 14:00] => 0:45
CLOCK: [2018-01-08 Mon 16:15]--[2018-01-10 Wed 13:10] => 44:55
CLOCK: [2018-01-10 Wed 10:07]--[2018-01-12 Fri 14:00] => 51:53
:END:
* Task 2
:LOGBOOK:
CLOCK: [2018-01-07 Sun 15:13]--[2018-01-07 Sun 16:17] => 1:04
CLOCK: [2018-01-08 Mon 16:00]--[2018-01-08 Mon 16:15] => 0:15
:END:
")
(org-mode)
(should (equal (timeline-tools-clockline-no-conflict
(org-time-string-to-seconds "[2018-01-07 Sun 13:00]")
(org-time-string-to-seconds "[2018-01-11 Thu 13:33]")
(current-buffer))
"CLOCK: [2018-01-07 Sun 13:00]--[2018-01-11 Thu 13:33] => 96:33"))
(should (equal (buffer-string)
"
* Task 1
:LOGBOOK:
CLOCK: [2018-01-11 Thu 13:33]--[2018-01-12 Fri 14:00] => 24:27
:END:
* Task 2
:LOGBOOK:
:END:
"))))