Complete error coverage of Parser and SyntaxChecker

This commit is contained in:
a3d4
2020-09-29 16:07:02 +02:00
parent 2037b7d6b8
commit 3698cd54a5
13 changed files with 60 additions and 33 deletions
-29
View File
@@ -124,35 +124,6 @@ BOOST_AUTO_TEST_CASE(reserved_keywords)
BOOST_CHECK(!TokenTraits::isReservedKeyword(Token::Illegal));
}
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"(
pragma solidity ^99.99.0;
this is surely invalid
)";
CHECK_PARSE_ERROR(text, "Source file requires different compiler version");
}
BOOST_AUTO_TEST_CASE(unsatisfied_version_with_recovery)
{
char const* text = R"(
pragma solidity ^99.99.0;
contract test {
uint ;
}
)";
Error err = getError(text, true);
BOOST_CHECK(searchErrorMessage(err, "Expected identifier but got ';'"));
}
BOOST_AUTO_TEST_CASE(function_natspec_documentation)
{
char const* text = R"(