mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-02-25 03:44:52 +00:00
Cron.pm: wip
git-svn-id: https://svn.fhem.de/fhem/trunk@27883 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
acc848dc9a
commit
801d1b3203
@ -52,6 +52,16 @@ my $test = [
|
||||
# [q(must throw an error '$cron_text'), '20~10 * * * *', 0, 0, qr(^syntax error in minute item:)],
|
||||
# # negative tests for minute / value range
|
||||
|
||||
# positive tests for weekday
|
||||
[q(handle '$cron_text'), '0 0 * * *', qr(^$), sub {my @r = (20230101000000); for my $d (2..31) {for my $h (0) {for my $m (0) {push @r, sprintf('202301%02d%02d%02d00', $d, $h, $m)}}}; @r}->()],
|
||||
[q(handle '$cron_text'), '0 0 * * 1', qr(^$), 20230101000000, 20230102000000, 20230109000000, 20230116000000 ],
|
||||
[q(handle '$cron_text'), '0 0 * * 1-5', qr(^$), 20230101000000, 20230102000000, 20230103000000, 20230104000000, 20230105000000, 20230106000000 ],
|
||||
[q(handle '$cron_text'), '0 0 * * 1-5/1', qr(^$), 20230101000000, 20230102000000, 20230103000000, 20230104000000, 20230105000000, 20230106000000 ],
|
||||
[q(handle '$cron_text'), '0 0 * * 1-5/2', qr(^$), 20230101000000, 20230102000000, 20230104000000, 20230106000000 ],
|
||||
[q(handle '$cron_text'), '0 0 * * 1-5,6', qr(^$), 20230101000000, 20230102000000, 20230103000000, 20230104000000, 20230105000000, 20230106000000, 20230107000000 ],
|
||||
[q(handle '$cron_text'), '0 0 8 * 1-5,6', qr(^$), 20230101000000, 20230102000000, 20230103000000, 20230104000000, 20230105000000, 20230106000000, 20230107000000, 20230108000000 ],
|
||||
[q(handle '$cron_text'), '0 0 8 * &1-5,6', qr(^$), 20230101000000, 20230102000000, 20230103000000, 20230104000000, 20230105000000, 20230106000000, 20230107000000, 20230108000000 ],
|
||||
|
||||
# time series
|
||||
[q(Timeseries '$cron_text'), '0 12 3,4,5 2 0,2,3,4', qr(^$), 20230102150000, 20230201120000, 20230202120000, 20230203120000, 20230204120000],
|
||||
[q(Feb-29 & Sunday '$cron_text'), '0 12 29 2 &7', qr(^$), 20230102150000, 20320229120000],
|
||||
|
Loading…
x
Reference in New Issue
Block a user