diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2018-12-18 19:17:52 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2018-12-18 23:02:59 +0800 |
commit | bd2f2ecbbd20f8d861d7a068954ea2e27d7f02be (patch) | |
tree | 35f098b0227d64b4d785e7508e74873ea5aaea63 /test | |
parent | ba15bc0a2325c50578247c3ee477a3d49a6f8cf1 (diff) | |
download | dexon-solidity-bd2f2ecbbd20f8d861d7a068954ea2e27d7f02be.tar.gz dexon-solidity-bd2f2ecbbd20f8d861d7a068954ea2e27d7f02be.tar.zst dexon-solidity-bd2f2ecbbd20f8d861d7a068954ea2e27d7f02be.zip |
Move unsatisfied_version test from SolidityNameAndTypeResolution to SolidityParser
Diffstat (limited to 'test')
-rw-r--r-- | test/libsolidity/SolidityNameAndTypeResolution.cpp | 12 | ||||
-rw-r--r-- | test/libsolidity/SolidityParser.cpp | 8 |
2 files changed, 8 insertions, 12 deletions
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp index 75726027..774f67fe 100644 --- a/test/libsolidity/SolidityNameAndTypeResolution.cpp +++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp @@ -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"( diff --git a/test/libsolidity/SolidityParser.cpp b/test/libsolidity/SolidityParser.cpp index 619d6a48..a33c6134 100644 --- a/test/libsolidity/SolidityParser.cpp +++ b/test/libsolidity/SolidityParser.cpp @@ -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"( |