From b86def339ef3a59a027eac14d0ea0c9c8bcf4067 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Kami=C5=84ski?= Date: Sun, 10 Jun 2018 23:43:12 +0200 Subject: [PATCH] Test for utc during leap second insertion --- test/clock_cast_test/local_t.pass.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/clock_cast_test/local_t.pass.cpp b/test/clock_cast_test/local_t.pass.cpp index b6a33bb..b1bb65e 100644 --- a/test/clock_cast_test/local_t.pass.cpp +++ b/test/clock_cast_test/local_t.pass.cpp @@ -29,7 +29,6 @@ main() assert(st.time_since_epoch() == seconds(946684800)); } - /// utc epoch { auto lu = local_days{1970_y/01/01_d}; @@ -38,6 +37,14 @@ main() assert(ut.time_since_epoch() == seconds(0)); } + // utc leap second + { + auto lu = local_days{2015_y/07/01_d} - milliseconds(1); + auto ut = clock_cast(lu) + milliseconds(50); //into leap second + + assert(clock_cast(ut) == lu); + } + /// utc paper example { auto lu = local_days{2000_y/01/01_d};