mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Move unsatisfied_version test from SolidityNameAndTypeResolution to SolidityParser
This commit is contained in:
parent
ba15bc0a23
commit
bd2f2ecbbd
@ -376,18 +376,6 @@ BOOST_AUTO_TEST_CASE(warn_nonpresent_pragma)
|
|||||||
BOOST_CHECK(searchErrorMessage(*sourceAndError.second.front(), "Source file does not specify required compiler version!"));
|
BOOST_CHECK(searchErrorMessage(*sourceAndError.second.front(), "Source file does not specify required compiler version!"));
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(unsatisfied_version)
|
|
||||||
{
|
|
||||||
char const* text = R"(
|
|
||||||
pragma solidity ^99.99.0;
|
|
||||||
)";
|
|
||||||
auto sourceAndError = parseAnalyseAndReturnError(text, false, false, false);
|
|
||||||
BOOST_REQUIRE(!sourceAndError.second.empty());
|
|
||||||
BOOST_REQUIRE(!!sourceAndError.first);
|
|
||||||
BOOST_CHECK(sourceAndError.second.front()->type() == Error::Type::SyntaxError);
|
|
||||||
BOOST_CHECK(searchErrorMessage(*sourceAndError.second.front(), "Source file requires different compiler version"));
|
|
||||||
}
|
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(returndatasize_as_variable)
|
BOOST_AUTO_TEST_CASE(returndatasize_as_variable)
|
||||||
{
|
{
|
||||||
char const* text = R"(
|
char const* text = R"(
|
||||||
|
@ -113,6 +113,14 @@ while(0)
|
|||||||
|
|
||||||
BOOST_AUTO_TEST_SUITE(SolidityParser)
|
BOOST_AUTO_TEST_SUITE(SolidityParser)
|
||||||
|
|
||||||
|
BOOST_AUTO_TEST_CASE(unsatisfied_version)
|
||||||
|
{
|
||||||
|
char const* text = R"(
|
||||||
|
pragma solidity ^99.99.0;
|
||||||
|
)";
|
||||||
|
CHECK_PARSE_ERROR(text, "Source file requires different compiler version");
|
||||||
|
}
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(unsatisfied_version_followed_by_invalid_syntax)
|
BOOST_AUTO_TEST_CASE(unsatisfied_version_followed_by_invalid_syntax)
|
||||||
{
|
{
|
||||||
char const* text = R"(
|
char const* text = R"(
|
||||||
|
Loading…
Reference in New Issue
Block a user