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

Method validateTestConfiguration

test/libsolidity/ASTJSONTest.cpp:161–182  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

159}
160
161void ASTJSONTest::validateTestConfiguration() const
162{
163 if (m_variants.empty())
164 BOOST_THROW_EXCEPTION(std::runtime_error("No file with expected result found."));
165
166 if (m_expectedFailAfter.has_value())
167 {
168 auto unexpectedTestVariant = std::find_if(
169 m_variants.begin(), m_variants.end(),
170 [failAfter = m_expectedFailAfter](TestVariant v) { return v.stopAfter > failAfter; }
171 );
172
173 if (unexpectedTestVariant != m_variants.end())
174 BOOST_THROW_EXCEPTION(
175 std::runtime_error(
176 std::string("Unexpected JSON file: ") + unexpectedTestVariant->astFilename() +
177 " in \"failAfter: " +
178 compilerStateToString(m_expectedFailAfter.value()) + "\" scenario."
179 )
180 );
181 }
182}
183
184ASTJSONTest::ASTJSONTest(std::string const& _filename):
185 EVMVersionRestrictedTestCase(_filename)

Callers

nothing calls this directly

Calls 6

compilerStateToStringFunction · 0.85
astFilenameMethod · 0.80
emptyMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected