summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2016-08-31 01:58:13 +0200
committerlouiz’ <louiz@louiz.org>2016-08-31 01:58:13 +0200
commit1140db3b88bb70cbcab044efa729707bd5a442f6 (patch)
tree37a1a5375533647f2cf66c0f027c8a1674536b27 /tests
parent2a4905df0153c47656555a21f3d57bbad6f3ffe1 (diff)
downloadbiboumi-1140db3b88bb70cbcab044efa729707bd5a442f6.tar.gz
biboumi-1140db3b88bb70cbcab044efa729707bd5a442f6.tar.bz2
biboumi-1140db3b88bb70cbcab044efa729707bd5a442f6.tar.xz
biboumi-1140db3b88bb70cbcab044efa729707bd5a442f6.zip
Add parse_datetime
Diffstat (limited to 'tests')
-rw-r--r--tests/utils.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/utils.cpp b/tests/utils.cpp
index abe7ef7..084a048 100644
--- a/tests/utils.cpp
+++ b/tests/utils.cpp
@@ -121,3 +121,11 @@ TEST_CASE("time_to_string")
CHECK(utils::to_string(stamp).size() == result.size());
CHECK(utils::to_string(0) == "1970-01-01T00:00:00Z");
}
+
+TEST_CASE("parse_datetime")
+{
+ const auto time = utils::parse_datetime("1970-01-01T00:00:00Z");
+ CHECK(time == 0);
+ CHECK(utils::parse_datetime("2016-08-29T14:29:28Z") == 1472480968);
+ CHECK(utils::parse_datetime("blah") == -1);
+} \ No newline at end of file