aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src/tests.chrono.cpp
diff options
context:
space:
mode:
authorCurtis J Bezault <curtbezault@gmail.com>2019-07-19 08:08:08 -0700
committerGitHub <noreply@github.com>2019-07-19 08:08:08 -0700
commit18c849daea115310d7ee985e5af99ba96e6b79fe (patch)
treee8fdf76fe31cd299c84a1e16877aa217c9bab9d5 /toolsrc/src/tests.chrono.cpp
parente81d22ddec6887a497055d4804a004ca662b4526 (diff)
parent618fa203c13c30bd19826988cff66481bca0562f (diff)
downloadvcpkg-18c849daea115310d7ee985e5af99ba96e6b79fe.tar.gz
vcpkg-18c849daea115310d7ee985e5af99ba96e6b79fe.zip
Merge branch 'master' into external_file_abi
Diffstat (limited to 'toolsrc/src/tests.chrono.cpp')
-rw-r--r--toolsrc/src/tests.chrono.cpp41
1 files changed, 0 insertions, 41 deletions
diff --git a/toolsrc/src/tests.chrono.cpp b/toolsrc/src/tests.chrono.cpp
deleted file mode 100644
index 269cdca58..000000000
--- a/toolsrc/src/tests.chrono.cpp
+++ /dev/null
@@ -1,41 +0,0 @@
-#include "tests.pch.h"
-
-using namespace Microsoft::VisualStudio::CppUnitTestFramework;
-
-namespace Chrono = vcpkg::Chrono;
-
-namespace UnitTest1
-{
- class ChronoTests : public TestClass<ChronoTests>
- {
- TEST_METHOD(parse_time)
- {
- auto timestring = "1990-02-03T04:05:06.0Z";
- auto maybe_time = Chrono::CTime::parse(timestring);
-
- Assert::IsTrue(maybe_time.has_value());
-
- Assert::AreEqual(timestring, maybe_time.get()->to_string().c_str());
- }
-
- TEST_METHOD(parse_time_blank)
- {
- auto maybe_time = Chrono::CTime::parse("");
-
- Assert::IsFalse(maybe_time.has_value());
- }
-
- TEST_METHOD(time_difference)
- {
- auto maybe_time1 = Chrono::CTime::parse("1990-02-03T04:05:06.0Z");
- auto maybe_time2 = Chrono::CTime::parse("1990-02-10T04:05:06.0Z");
-
- Assert::IsTrue(maybe_time1.has_value());
- Assert::IsTrue(maybe_time2.has_value());
-
- auto delta = maybe_time2.get()->to_time_point() - maybe_time1.get()->to_time_point();
-
- Assert::AreEqual(24 * 7, std::chrono::duration_cast<std::chrono::hours>(delta).count());
- }
- };
-}