Wrapping values in ranges should not validate #17
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A pattern like
* 17-2/3 * * *
or58-2 * * * *
that has a range wrapping around the starting value (e.g. 0 minute, 0 hour, Sunday) should not validate, but currently does inpoliander/cron
v3.0.5On UNIX/Linux systems, those patterns seem to be valid, as the
crontab
command does not complain (no parsing error) when saving. But those expressions have been proven to be non-working (tested).man 5 crontab
doesn't say anything specifically about this, but it also doesn't provide any examples with wrapping ranges.Other libraries like croner (JS) are considering such wrapping ranges as invalid (see my comment on Hexagon/croner#199).
I have added an extra check in
validateRange()
and have updated the test dataset.