Skip to content

Commit

Permalink
Hooks: Expand tests
Browse files Browse the repository at this point in the history
Signed-off-by: xerus2000 <[email protected]>
  • Loading branch information
xeruf authored and lauft committed Mar 8, 2025
1 parent ea5bdf6 commit ed4da79
Showing 1 changed file with 25 additions and 11 deletions.
36 changes: 25 additions & 11 deletions test-hooks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ checkdom() {
}

highlight A new task is started with correct time
task add test +t1 +t2 start:2020-04-04 entry:2020-04-03
task add test +t1 start:2020-04-04 entry:2020-04-03
debug task 1 info
checkdom active.start "2020-04-04T00:00:00"

Expand All @@ -32,21 +32,35 @@ debug timew
checkdom active.start "2020-04-05T12:00:00"

highlight Modify tags
task 1 modify +t3 project:testing
checkdom tag.count "5"
task 1 modify +t2 project:testing
checkdom tag.count 4

checkcur() {
checkdom tracked.count 1
checkdom tag.count 4
checkdom active.tag.count 4
checkdom active.start "2020-04-05T12:00:00"
}

highlight Modify start time of second task
task add test2 +t2 entry:2020-04-03
task add test2 +t3 entry:2020-04-03
task 2 modify start:2020-04-06
checkdom tracked.count "1"
checkdom tag.count "5"
checkdom active.start "2020-04-05T12:00:00"
checkcur

highlight Modify tags of second now started task
task 2 modify +t3
debug timew
checkdom tag.count "5"
checkdom active.start "2020-04-05T12:00:00"
checkcur

highlight Stop second task
task 2 stop
checkcur

highlight Start different task
#task start 1
highlight Switch active task and don\'t override previous interval
task 1 stop
timew modify end @1 2020-04-07T00:00
#Automatically correct overlap, needs support in timew core
#task 2 modify start:today
! task 2 modify start:2020-04-05T00:00
task 2 modify start:2020-04-07
checkdom active.tag.count 2

0 comments on commit ed4da79

Please sign in to comment.