Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrapping values in ranges should not validate #17

Merged
merged 2 commits into from Jul 30, 2023

Conversation

onlime
Copy link
Contributor

@onlime onlime commented Jul 12, 2023

A pattern like * 17-2/3 * * * or 58-2 * * * * that has a range wrapping around the starting value (e.g. 0 minute, 0 hour, Sunday) should not validate, but currently does in poliander/cron v3.0.5

On 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.

@poliander
Copy link
Owner

poliander commented Jul 12, 2023

I'll look into it the next few days, thank you very much!

@poliander poliander merged commit e501b01 into poliander:main Jul 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants