aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2018-12-12 23:45:17 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2018-12-18 23:02:35 +0800
commitc2ec6d71b4707dab9b7727347077904b7a90eaf2 (patch)
treee53763da22d68f1b97a5390f07c4d09c633baefa /test
parentc60ec958abea4f63eea8783d67a5054ca04d0a64 (diff)
downloaddexon-solidity-c2ec6d71b4707dab9b7727347077904b7a90eaf2.tar.gz
dexon-solidity-c2ec6d71b4707dab9b7727347077904b7a90eaf2.tar.zst
dexon-solidity-c2ec6d71b4707dab9b7727347077904b7a90eaf2.zip
Add version pragma parsing to Parser
Diffstat (limited to 'test')
-rw-r--r--test/libsolidity/SolidityParser.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityParser.cpp b/test/libsolidity/SolidityParser.cpp
index d86d3d39..619d6a48 100644
--- a/test/libsolidity/SolidityParser.cpp
+++ b/test/libsolidity/SolidityParser.cpp
@@ -113,6 +113,15 @@ while(0)
BOOST_AUTO_TEST_SUITE(SolidityParser)
+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(function_natspec_documentation)
{
char const* text = R"(