Skip to content

Commit

Permalink
Fix Windows test
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Carroll <michael@openrobotics.org>
  • Loading branch information
mjcarroll committed Aug 31, 2021
1 parent 1d20196 commit 44c4b23
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/Helpers_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,27 @@ 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));
}

{
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));
}
}

Expand Down

0 comments on commit 44c4b23

Please sign in to comment.