summaryrefslogtreecommitdiffstats
path: root/src/test/test-date.c
diff options
context:
space:
mode:
authorHristo Venev <hristo@venev.name>2015-10-25 17:25:58 +0100
committerHristo Venev <hristo@venev.name>2015-10-25 17:46:20 +0100
commitb1c517669986f23960b60ef637f141be9f7033f5 (patch)
treed80c134d458c3389ade517c3641fb1de8df8ddae /src/test/test-date.c
parentbasic: use the return value of endswith (diff)
downloadsystemd-b1c517669986f23960b60ef637f141be9f7033f5.tar.xz
systemd-b1c517669986f23960b60ef637f141be9f7033f5.zip
test: "today UTC" is not always "today UTC"
On Oct 25 2015 in EET/EEST there is a UTC+3->UTC+2 transition. This means that the representation of "today UTC" as local time is ambiguous.
Diffstat (limited to 'src/test/test-date.c')
-rw-r--r--src/test/test-date.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/test/test-date.c b/src/test/test-date.c
index 8d78ab89d0..e1c6ecb2ef 100644
--- a/src/test/test-date.c
+++ b/src/test/test-date.c
@@ -43,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;
@@ -86,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;
}