Move unsatisfied_version test from SolidityNameAndTypeResolution to SolidityParser

This commit is contained in:
Alex Beregszaszi 2018-12-18 11:17:52 +00:00
parent ba15bc0a23
commit bd2f2ecbbd
2 changed files with 8 additions and 12 deletions

View File

@ -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_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)
{
char const* text = R"(

View File

@ -113,6 +113,14 @@ while(0)
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)
{
char const* text = R"(