| 571 | } |
| 572 | |
| 573 | void |
| 574 | test_S() |
| 575 | { |
| 576 | using namespace date; |
| 577 | using namespace std::chrono; |
| 578 | using date::sys_time; |
| 579 | { |
| 580 | std::istringstream in{"2016-12-11 15"}; |
| 581 | sys_seconds tp; |
| 582 | in >> parse("%F %S", tp); |
| 583 | assert(!in.fail()); |
| 584 | assert(!in.bad()); |
| 585 | assert(tp == sys_days{2016_y/12/11} + seconds{15}); |
| 586 | } |
| 587 | { |
| 588 | std::istringstream in{"2016-12-11 15.001"}; |
| 589 | sys_time<milliseconds> tp; |
| 590 | in >> parse("%F %S", tp); |
| 591 | assert(!in.fail()); |
| 592 | assert(!in.bad()); |
| 593 | assert(tp == sys_days{2016_y/12/11} + seconds{15} + milliseconds{1}); |
| 594 | } |
| 595 | { |
| 596 | std::istringstream in{"2016-12-11 60"}; |
| 597 | sys_seconds tp; |
| 598 | in >> parse("%F %S", tp); |
| 599 | assert(in.fail()); |
| 600 | } |
| 601 | } |
| 602 | |
| 603 | void |
| 604 | test_T() |