Merge pull request #13649 from Andy53/output-emit-logs-correctly

fix emit statments being printed on the same line
This commit is contained in:
Kamil Śliwak 2022-10-25 21:31:27 +02:00 committed by GitHub
commit 799ef0ab1a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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()) if (!sideEffects.empty())
{ {
stream << std::endl; stream << std::endl;
for (string const& effect: sideEffects) size_t i = 0;
{ for (; i < sideEffects.size() - 1; ++i)
stream << _linePrefix << "// ~ " << effect; stream << _linePrefix << "// ~ " << sideEffects[i] << std::endl;
if (effect != *sideEffects.rbegin()) stream << _linePrefix << "// ~ " << sideEffects[i];
stream << std::endl;
}
} }
stream << formatGasExpectations(_linePrefix, _renderMode == RenderMode::ExpectedValuesActualGas, _interactivePrint); stream << formatGasExpectations(_linePrefix, _renderMode == RenderMode::ExpectedValuesActualGas, _interactivePrint);