MCPcopy Create free account
hub / github.com/argotorg/solidity / formatNatspecExpectations

Method formatNatspecExpectations

test/libsolidity/NatspecJSONTest.cpp:168–186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

166}
167
168std::string NatspecJSONTest::formatNatspecExpectations(NatspecMap const& _expectations) const
169{
170 std::string output;
171 bool first = true;
172 // NOTE: Not sorting explicitly because CompilerStack seems to put contracts roughly in the
173 // order in which they appear in the source, which is much better than alphabetical order.
174 for (auto const& [contractName, expectationsForAllKinds]: _expectations)
175 for (auto const& [jsonKind, natspecJSON]: expectationsForAllKinds)
176 {
177 if (!first)
178 output += "\n\n";
179 first = false;
180
181 output += contractName + " " + toString(jsonKind) + "\n";
182 output += jsonPrint(natspecJSON, {JsonFormat::Pretty, 4});
183 }
184
185 return output;
186}
187
188NatspecMap NatspecJSONTest::obtainedNatspec() const
189{

Callers

nothing calls this directly

Calls 2

jsonPrintFunction · 0.85
toStringFunction · 0.50

Tested by

no test coverage detected