diff options
author | Douglas Christman <DouglasChristman@gmail.com> | 2016-11-24 14:04:13 -0500 |
---|---|---|
committer | Douglas Christman <DouglasChristman@gmail.com> | 2016-11-24 18:22:08 -0500 |
commit | 6bae2fd4cdddd6c34f3d5e79906d8f6a75125922 (patch) | |
tree | 33840260dc3d6e8fdffae6bf9814b64126f26a0f /src/test | |
parent | 04773cb50aca6484921c40bef3cbc0171c1e4786 (diff) |
calendarspec: reject open weekday ranges
Forbid open ranges like "Tue.."; trailing commas are still OK.
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/test-calendarspec.c | 3 |
1 files changed, 3 insertions, 0 deletions
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(); |