fix emit statments being printed on the same line

Update test/libsolidity/semanticTests/emit_three_identical_events.sol

Co-authored-by: Kamil Śliwak <cameel2@gmail.com>

Update test/libsolidity/semanticTests/emit_two_identical_events.sol

Co-authored-by: Nikola Matić <nikola.matic@ethereum.org>
This commit is contained in:
andy53 2022-10-24 13:22:39 -06:00 committed by Nikola Matic
parent 84cdcec2cf
commit 54965fb0ae
3 changed files with 30 additions and 6 deletions

View File

@ -0,0 +1,14 @@
contract C {
event Terminated();
function terminate() external {
emit Terminated();
emit Terminated();
emit Terminated();
}
}
// ----
// terminate() ->
// ~ emit Terminated()
// ~ emit Terminated()
// ~ emit Terminated()

View File

@ -0,0 +1,12 @@
contract C {
event Terminated();
function terminate() external {
emit Terminated();
emit Terminated();
}
}
// ----
// terminate() ->
// ~ emit Terminated()
// ~ emit Terminated()

View File

@ -208,12 +208,10 @@ string TestFunctionCall::format(
if (!sideEffects.empty())
{
stream << std::endl;
for (string const& effect: sideEffects)
{
stream << _linePrefix << "// ~ " << effect;
if (effect != *sideEffects.rbegin())
stream << std::endl;
}
size_t i = 0;
for (; i < sideEffects.size() - 1; ++i)
stream << _linePrefix << "// ~ " << sideEffects[i] << std::endl;
stream << _linePrefix << "// ~ " << sideEffects[i];
}
stream << formatGasExpectations(_linePrefix, _renderMode == RenderMode::ExpectedValuesActualGas, _interactivePrint);