mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #11650 from ethereum/boost-path-in-read-file-as-string
Use `boost::filesystem::path` in `readFileAsString()`
This commit is contained in:
@@ -168,7 +168,7 @@ pair<SourceMap, size_t> TestCaseReader::parseSourcesAndSettingsWithLineNumber(is
|
||||
if (!fs::exists(externalSourceFullPath))
|
||||
BOOST_THROW_EXCEPTION(runtime_error("External Source '" + externalSourceTarget.string() + "' not found."));
|
||||
else
|
||||
externalSourceContent = util::readFileAsString(externalSourceFullPath.string());
|
||||
externalSourceContent = util::readFileAsString(externalSourceFullPath);
|
||||
|
||||
if (sources.count(externalSourceName))
|
||||
BOOST_THROW_EXCEPTION(runtime_error("Multiple definitions of test source \"" + externalSourceName + "\"."));
|
||||
|
||||
@@ -44,13 +44,13 @@ BOOST_AUTO_TEST_CASE(readFileAsString_regular_file)
|
||||
TemporaryDirectory tempDir("common-io-test-");
|
||||
createFileWithContent(tempDir.path() / "test.txt", "ABC\ndef\n");
|
||||
|
||||
BOOST_TEST(readFileAsString((tempDir.path() / "test.txt").string()) == "ABC\ndef\n");
|
||||
BOOST_TEST(readFileAsString(tempDir.path() / "test.txt") == "ABC\ndef\n");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(readFileAsString_directory)
|
||||
{
|
||||
TemporaryDirectory tempDir("common-io-test-");
|
||||
BOOST_CHECK_THROW(readFileAsString(tempDir.path().string()), NotAFile);
|
||||
BOOST_CHECK_THROW(readFileAsString(tempDir.path()), NotAFile);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(readFileAsString_symlink)
|
||||
@@ -61,7 +61,7 @@ BOOST_AUTO_TEST_CASE(readFileAsString_symlink)
|
||||
if (!createSymlinkIfSupportedByFilesystem("test.txt", tempDir.path() / "symlink.txt"))
|
||||
return;
|
||||
|
||||
BOOST_TEST(readFileAsString((tempDir.path() / "symlink.txt").string()) == "ABC\ndef\n");
|
||||
BOOST_TEST(readFileAsString(tempDir.path() / "symlink.txt") == "ABC\ndef\n");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
|
||||
Reference in New Issue
Block a user