5
0
mirror of git://git.proxmox.com/git/pve-common.git synced 2024-12-22 21:33:47 +03:00
Commit Graph

7 Commits

Author SHA1 Message Date
Dominik Csapak
9572e1046b CalendarEvent: use rust implementation
by replacing the parsing code and 'compute_next_event' by their
PVE::RS::CalendarEvent equivalent

adapt the tests, since we do not have access to the internal structure
(and even if we had, it would be different) and the error messages
are different

the 'compute_next_event' and parsing tests still pass though

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2022-01-13 14:50:47 +01:00
Wolfgang Bumiller
f236e57602 tests: update to utc flag and add daylight savings test
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-10-31 14:56:45 +01:00
Dominik Csapak
e2c29de775 add ability to have multiple timespecs for hours and minutes
so things like: 2,4:0 will work

also add regression tests for this

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-06-13 11:36:20 +02:00
Dominik Csapak
a5ffa49fda trim event and check if empty
give a meaningful error if it is empty and disallow it instead of having
an implicit default (the default should be set by the component using
the calendarevent, not the calendarevent itself)

also add regression tests

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-06-13 11:36:11 +02:00
Dominik Csapak
057c619ab2 calendarevent: check range for start also without repetition
else an event like "61" never finishes when calculating the next event

also add regression tests for this and other range checks

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-06-02 09:30:55 +02:00
Dominik Csapak
a4200306fe calendarevent: change sorting of hours and minutes to numeric
otherwise the numbers are sorted like this:
[1,10,11 .. 19, 2, 20, ..]
which would lead to the wrong next time

also add regression tests for this and mixed forms like:
20..22:*/30

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2017-05-31 08:37:19 +02:00
Dietmar Maurer
3ebebd191d test/calendar_event_test.pl: regression tests for PVE::CalendarEvent 2017-05-17 13:38:16 +02:00