summaryrefslogtreecommitdiff
path: root/src/test/test-calendarspec.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-11-23 22:31:01 +0100
committerGitHub <noreply@github.com>2016-11-23 22:31:01 +0100
commit99245111ac4b2b4275c8caeb03c14f7870afbb85 (patch)
tree243d807f6888067903eb88924d43e44da0f1d9b6 /src/test/test-calendarspec.c
parent331d6a201b82a03c5343bb9c25280f0cd8b7d9fb (diff)
parent8ea803516e4a4265a77d026f740c272cd60107a4 (diff)
Merge pull request #4703 from dobyrch/calendar-offset
calendarspec: add support for scheduling timers at the end of the month
Diffstat (limited to 'src/test/test-calendarspec.c')
-rw-r--r--src/test/test-calendarspec.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/test/test-calendarspec.c b/src/test/test-calendarspec.c
index 59217b131c..76f5819bb9 100644
--- a/src/test/test-calendarspec.c
+++ b/src/test/test-calendarspec.c
@@ -176,6 +176,9 @@ int main(int argc, char* argv[]) {
test_one("1..3-1..3 1..3:1..3", "*-01,02,03-01,02,03 01,02,03:01,02,03:00");
test_one("00:00:1.125..2.125", "*-*-* 00:00:01.125000,02.125000");
test_one("00:00:1.0..3.8", "*-*-* 00:00:01,02,03");
+ test_one("*-*~1 Utc", "*-*~01 00:00:00 UTC");
+ test_one("*-*~05,3 ", "*-*~03,05 00:00:00");
+ test_one("*-*~* 00:00:00", "*-*-* 00:00:00");
test_next("2016-03-27 03:17:00", "", 12345, 1459048620000000);
test_next("2016-03-27 03:17:00", "CET", 12345, 1459041420000000);
@@ -190,6 +193,10 @@ int main(int argc, char* argv[]) {
test_next("2015-11-13 09:11:23.42/1.77", "EET", 1447398683420000, 1447398685190000);
test_next("2015-11-13 09:11:23.42/1.77", "EET", 1447398683419999, 1447398683420000);
test_next("Sun 16:00:00", "CET", 1456041600123456, 1456066800000000);
+ test_next("*-04-31", "", 12345, -1);
+ test_next("2016-02~01 UTC", "", 12345, 1456704000000000);
+ test_next("Mon 2017-05~01..07 UTC", "", 12345, 1496016000000000);
+ test_next("Mon 2017-05~07/1 UTC", "", 12345, 1496016000000000);
assert_se(calendar_spec_from_string("test", &c) < 0);
assert_se(calendar_spec_from_string("", &c) < 0);
@@ -199,6 +206,8 @@ int main(int argc, char* argv[]) {
assert_se(calendar_spec_from_string("2000-03-05 00:00.1:00", &c) < 0);
assert_se(calendar_spec_from_string("00:00:00/0.00000001", &c) < 0);
assert_se(calendar_spec_from_string("00:00:00.0..00.9", &c) < 0);
+ assert_se(calendar_spec_from_string("2016~11-22", &c) < 0);
+ assert_se(calendar_spec_from_string("*-*~5/5", &c) < 0);
test_timestamp();
test_hourly_bug_4031();