Accept multi-digit hours and reject zero-length durations #9
Labels
No labels
wayfinder
grilling
wayfinder
map
wayfinder
prototype
wayfinder
research
wayfinder
task
workflow
needs-info
workflow
needs-triage
workflow
ready-for-agent
workflow
ready-for-human
workflow
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
rosa/tomate#9
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What to build
--durationshould accept every duration it documents, and reject the ones it cannot honour.Two defects in the same parser. Hours are matched as a single digit while minutes and seconds are matched as one-or-more, so any duration of ten hours or longer is rejected:
And every group in the pattern is optional, so an empty string matches and yields a zero-length timer. The parser's own
expectclaims to catch this and never fires, because a zeroTimeDeltais perfectly valid:A zero-length Pomodoro is born already finished, and the progress bar it prints divides by zero.
Acceptance criteria
-d 10h,-d 24h, and-d 100hparse successfully-d ""is rejected with the parser's usage message-d 0s,-d 0m, and any other combination totalling zero are rejected with a message that says a duration must be longer than zeroexpectabout nonzero durations is gone or made trueBlocked by
None — can start immediately.