summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2019-12-16 23:15:48 +0100
committerMax Kellermann <max@musicpd.org>2019-12-16 23:31:29 +0100
commit15ce8eb48793b3d74fea041e8fe6b8fdbb328a04 (patch)
treede45acdc7c979f056af517c340a51c774ab7d16f /test
parentb7744be20806a9cc3697f0806eb452012e7180be (diff)
time/ISO8601: support omitting field separators
Closes https://github.com/MusicPlayerDaemon/MPD/issues/685
Diffstat (limited to 'test')
-rw-r--r--test/TestISO8601.cxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/TestISO8601.cxx b/test/TestISO8601.cxx
index 3305b47de..cd0897c1a 100644
--- a/test/TestISO8601.cxx
+++ b/test/TestISO8601.cxx
@@ -71,6 +71,15 @@ static constexpr struct {
{ "2019-02-04T16:46:41+0200", 1549291601, std::chrono::seconds(1) },
{ "2019-02-04T16:46:41+02:00", 1549291601, std::chrono::seconds(1) },
{ "2019-02-04T16:46:41-0200", 1549306001, std::chrono::seconds(1) },
+
+ /* without field separators */
+ { "19700101T000000Z", 0, std::chrono::seconds(1) },
+ { "19700101T000001Z", 1, std::chrono::seconds(1) },
+ { "20190204T164641Z", 1549298801, std::chrono::seconds(1) },
+ { "19700101", 0, std::chrono::hours(24) },
+ { "20190204", 1549238400, std::chrono::hours(24) },
+ { "20190204T1646", 1549298760, std::chrono::minutes(1) },
+ { "20190204T16", 1549296000, std::chrono::hours(1) },
};
TEST(ISO8601, Parse)