Skip to content

Commit

Permalink
fixup! FileReader: Normalize base path and strip it from normalized s…
Browse files Browse the repository at this point in the history
…ource paths
  • Loading branch information
cameel committed Jul 24, 2021
1 parent 3a944d5 commit b8e7786
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/libsolidity/interface/FileReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,21 +184,21 @@ BOOST_AUTO_TEST_CASE(normalizeCLIPathForVFS_root_name_only)
#endif
}

#if defined(_WIN32)
BOOST_AUTO_TEST_CASE(normalizeCLIPathForVFS_stripping_root_name)
{
TemporaryDirectory tempDir(TEST_CASE_NAME);
TemporaryWorkingDirectory tempWorkDir(tempDir.path());

soltestAssert(boost::filesystem::current_path().is_absolute(), "");
#if defined(_WIN32)
soltestAssert(!boost::filesystem::current_path().root_name().empty(), "");
#endif

boost::filesystem::path normalizedPath = FileReader::normalizeCLIPathForVFS(boost::filesystem::current_path());
BOOST_CHECK_EQUAL(normalizedPath, "/" / boost::filesystem::current_path().relative_path());
BOOST_TEST(normalizedPath.root_name().empty());
BOOST_CHECK_EQUAL(normalizedPath.root_directory(), "/");
}
#endif

BOOST_AUTO_TEST_CASE(normalizeCLIPathForVFS_path_beyond_root)
{
Expand Down

0 comments on commit b8e7786

Please sign in to comment.