Skip to content

Commit

Permalink
fix emit statments being printed on the same line
Browse files Browse the repository at this point in the history
Update test/libsolidity/semanticTests/emit_three_identical_events.sol

Co-authored-by: Kamil Śliwak <[email protected]>

Update test/libsolidity/semanticTests/emit_two_identical_events.sol

Co-authored-by: Nikola Matić <[email protected]>
  • Loading branch information
Andy53 and nikola-matic committed Oct 25, 2022
1 parent 84cdcec commit 54965fb
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 6 deletions.
14 changes: 14 additions & 0 deletions test/libsolidity/semanticTests/emit_three_identical_events.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
contract C {
event Terminated();

function terminate() external {
emit Terminated();
emit Terminated();
emit Terminated();
}
}
// ----
// terminate() ->
// ~ emit Terminated()
// ~ emit Terminated()
// ~ emit Terminated()
12 changes: 12 additions & 0 deletions test/libsolidity/semanticTests/emit_two_identical_events.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
contract C {
event Terminated();

function terminate() external {
emit Terminated();
emit Terminated();
}
}
// ----
// terminate() ->
// ~ emit Terminated()
// ~ emit Terminated()
10 changes: 4 additions & 6 deletions test/libsolidity/util/TestFunctionCall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 54965fb

Please sign in to comment.