From 44c4b23a5def0bfd8ad4fddeb2d346c719c3d1eb Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Tue, 31 Aug 2021 13:10:42 -0500 Subject: [PATCH] Fix Windows test Signed-off-by: Michael Carroll --- src/Helpers_TEST.cc | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/Helpers_TEST.cc b/src/Helpers_TEST.cc index 7cbd73c2..7dbc3c8d 100644 --- a/src/Helpers_TEST.cc +++ b/src/Helpers_TEST.cc @@ -25,6 +25,14 @@ using namespace fuel_tools; ///////////////////////////////////////////////// TEST(HelpersTEST, UriToPathNoAuthority) { +#ifdef WIN32 + const std::string testStr1 = R"(localhost:8000\\some\\path)"; + const std::string testStr2 = R"(localhost:8000\\some\\path\\)"; +#else + const std::string testStr1 = R"(localhost:8000/some/path)"; + const std::string testStr2 = R"(localhost:8000/some/path/)"; +#endif + { common::URI uri{"http://localhost:8000"}; EXPECT_EQ("localhost:8000", uriToPath(uri)); @@ -32,14 +40,12 @@ TEST(HelpersTEST, UriToPathNoAuthority) { common::URI uri{"http://localhost:8000/some/path"}; - EXPECT_EQ(common::joinPaths("localhost:8000", "some", "path"), - uriToPath(uri)); + EXPECT_EQ(testStr1, uriToPath(uri)); } { common::URI uri{"http://localhost:8000/some/path/"}; - EXPECT_EQ(common::separator(common::joinPaths("localhost:8000", "some", - "path")), uriToPath(uri)); + EXPECT_EQ(testStr2, uriToPath(uri)); } }