From 6bae2fd4cdddd6c34f3d5e79906d8f6a75125922 Mon Sep 17 00:00:00 2001 From: Douglas Christman Date: Thu, 24 Nov 2016 14:04:13 -0500 Subject: calendarspec: reject open weekday ranges Forbid open ranges like "Tue.."; trailing commas are still OK. --- src/test/test-calendarspec.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/test') diff --git a/src/test/test-calendarspec.c b/src/test/test-calendarspec.c index c539d16867..93414c8508 100644 --- a/src/test/test-calendarspec.c +++ b/src/test/test-calendarspec.c @@ -143,6 +143,7 @@ int main(int argc, char* argv[]) { test_one("Wed-Wed,Wed *-1", "Wed *-*-01 00:00:00"); test_one("Wed..Wed,Wed *-1", "Wed *-*-01 00:00:00"); test_one("Wed, 17:48", "Wed *-*-* 17:48:00"); + test_one("Wednesday,", "Wed *-*-* 00:00:00"); test_one("Wed-Sat,Tue 12-10-15 1:2:3", "Tue..Sat 2012-10-15 01:02:03"); test_one("Wed..Sat,Tue 12-10-15 1:2:3", "Tue..Sat 2012-10-15 01:02:03"); test_one("*-*-7 0:0:0", "*-*-07 00:00:00"); @@ -213,6 +214,8 @@ int main(int argc, char* argv[]) { 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); + assert_se(calendar_spec_from_string("Monday.. 12:00", &c) < 0); + assert_se(calendar_spec_from_string("Monday..", &c) < 0); test_timestamp(); test_hourly_bug_4031(); -- cgit v1.2.3-54-g00ecf