mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Preserve original newlines in solidity::util::readUntilEnd()
This commit is contained in:
committed by
Kamil Śliwak
parent
967b282159
commit
020ecc2131
@@ -66,6 +66,30 @@ BOOST_AUTO_TEST_CASE(readFileAsString_symlink)
|
||||
BOOST_TEST(readFileAsString(tempDir.path() / "symlink.txt") == "ABC\ndef\n");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(readUntilEnd_no_ending_newline)
|
||||
{
|
||||
istringstream inputStream("ABC\ndef");
|
||||
BOOST_TEST(readUntilEnd(inputStream) == "ABC\ndef");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(readUntilEnd_with_ending_newline)
|
||||
{
|
||||
istringstream inputStream("ABC\ndef\n");
|
||||
BOOST_TEST(readUntilEnd(inputStream) == "ABC\ndef\n");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(readUntilEnd_cr_lf_newline)
|
||||
{
|
||||
istringstream inputStream("ABC\r\ndef");
|
||||
BOOST_TEST(readUntilEnd(inputStream) == "ABC\r\ndef");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(readUntilEnd_empty)
|
||||
{
|
||||
istringstream inputStream("");
|
||||
BOOST_TEST(readUntilEnd(inputStream) == "");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
|
||||
} // namespace solidity::util::test
|
||||
|
||||
@@ -153,7 +153,7 @@ BOOST_AUTO_TEST_CASE(cli_input)
|
||||
{"a", "b", "c/d/e/"},
|
||||
};
|
||||
map<string, string> expectedSources = {
|
||||
{"<stdin>", "\n"},
|
||||
{"<stdin>", ""},
|
||||
{(expectedDir1 / "input1.sol").generic_string(), ""},
|
||||
{(expectedDir2 / "input2.sol").generic_string(), ""},
|
||||
};
|
||||
@@ -854,7 +854,7 @@ BOOST_AUTO_TEST_CASE(cli_paths_to_source_unit_names_base_path_and_stdin)
|
||||
expectedOptions.modelChecker.initialize = true;
|
||||
|
||||
map<string, string> expectedSources = {
|
||||
{"<stdin>", "\n"},
|
||||
{"<stdin>", ""},
|
||||
};
|
||||
FileReader::FileSystemPathSet expectedAllowedDirectories = {};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user