| 166 | } |
| 167 | |
| 168 | std::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 | |
| 188 | NatspecMap NatspecJSONTest::obtainedNatspec() const |
| 189 | { |