diff --git a/test/date_test/parse.pass.cpp b/test/date_test/parse.pass.cpp index fe822c6e..a7fecfd0 100644 --- a/test/date_test/parse.pass.cpp +++ b/test/date_test/parse.pass.cpp @@ -623,6 +623,21 @@ test_p() assert(!in.bad()); assert(tp == sys_days{2016_y/12/11} + hours{23}); } + { + std::istringstream in{"1986-12-01 01:01:01 pm"}; + sys_time tp; + in >> parse("%Y-%m-%d %I:%M:%S %p", tp); + assert(!in.fail()); + assert(!in.bad()); + assert(tp == sys_days{1986_y/12/01} + hours{13} + minutes{01} + seconds{01}); + } + { + std::istringstream in{"1986-12-01 01:01:01"}; + sys_time tp; + in >> parse("%Y-%m-%d %I:%M:%S", tp); + // The test will fail because %I needs the %p option to shows if it is AM or PM + assert(in.fail()); + } } void