mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
now for SolidityEndToEndTest we can use compileRequireThrow<typename>
This commit is contained in:
parent
dd1e770009
commit
3f1042d23b
@ -4668,7 +4668,7 @@ BOOST_AUTO_TEST_CASE(dev_title_at_function_error)
|
|||||||
" function mul(uint a, uint second) returns(uint d) { return a * 7 + second; }\n"
|
" function mul(uint a, uint second) returns(uint d) { return a * 7 + second; }\n"
|
||||||
"}\n";
|
"}\n";
|
||||||
|
|
||||||
compileRequireThrow(sourceCode);
|
compileRequireThrow<DocstringParsingError>(sourceCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(dev_documenting_nonexistant_param)
|
BOOST_AUTO_TEST_CASE(dev_documenting_nonexistant_param)
|
||||||
@ -4680,7 +4680,7 @@ BOOST_AUTO_TEST_CASE(dev_documenting_nonexistant_param)
|
|||||||
" function mul(uint a, uint second) returns(uint d) { return a * 7 + second; }\n"
|
" function mul(uint a, uint second) returns(uint d) { return a * 7 + second; }\n"
|
||||||
"}\n";
|
"}\n";
|
||||||
|
|
||||||
compileRequireThrow(sourceCode);
|
compileRequireThrow<DocstringParsingError>(sourceCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -58,11 +58,12 @@ public:
|
|||||||
return m_output;
|
return m_output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <class Exceptiontype>
|
||||||
void compileRequireThrow(std::string const& _sourceCode)
|
void compileRequireThrow(std::string const& _sourceCode)
|
||||||
{
|
{
|
||||||
m_compiler.reset(false, m_addStandardSources);
|
m_compiler.reset(false, m_addStandardSources);
|
||||||
m_compiler.addSource("", _sourceCode);
|
m_compiler.addSource("", _sourceCode);
|
||||||
BOOST_REQUIRE_THROW(m_compiler.compile(m_optimize, m_optimizeRuns), DocstringParsingError);
|
BOOST_REQUIRE_THROW(m_compiler.compile(m_optimize, m_optimizeRuns), Exceptiontype);
|
||||||
}
|
}
|
||||||
|
|
||||||
bytes const& compileAndRun(
|
bytes const& compileAndRun(
|
||||||
|
Loading…
Reference in New Issue
Block a user