diff options
Diffstat (limited to 'src/test/test-date.c')
-rw-r--r-- | src/test/test-date.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/test/test-date.c b/src/test/test-date.c index bd1b2781df..e1c6ecb2ef 100644 --- a/src/test/test-date.c +++ b/src/test/test-date.c @@ -22,6 +22,7 @@ #include <string.h> #include "util.h" +#include "string-util.h" static void test_should_pass(const char *p) { usec_t t, q; @@ -42,6 +43,12 @@ static void test_should_pass(const char *p) { assert_se(parse_timestamp(buf, &q) >= 0); } +static void test_should_parse(const char *p) { + usec_t t; + + assert_se(parse_timestamp(p, &t) >= 0); +} + static void test_should_fail(const char *p) { usec_t t; @@ -85,7 +92,8 @@ int main(int argc, char *argv[]) { test_one_noutc("+2y 4d"); test_one_noutc("5months ago"); test_one_noutc("@1395716396"); - test_one_noutc("today UTC"); + test_should_parse("today UTC"); + test_should_fail("today UTC UTC"); return 0; } |