diff --git a/test/libsolidity/SemVerMatcher.cpp b/test/libsolidity/SemVerMatcher.cpp index b0fbb8547..a69b2a39d 100644 --- a/test/libsolidity/SemVerMatcher.cpp +++ b/test/libsolidity/SemVerMatcher.cpp @@ -171,6 +171,8 @@ BOOST_AUTO_TEST_CASE(negative_range) { // Negative range tests vector> tests = { + {"^0^1", "0.0.0"}, + {"^0^1", "1.0.0"}, {"1.0.0 - 2.0.0", "2.2.3"}, {"1.0", "1.0.0-pre"}, {"1", "1.0.0-pre"}, diff --git a/test/libsolidity/syntaxTests/pragma/broken_version_6.sol b/test/libsolidity/syntaxTests/pragma/broken_version_6.sol new file mode 100644 index 000000000..ab98e4f2a --- /dev/null +++ b/test/libsolidity/syntaxTests/pragma/broken_version_6.sol @@ -0,0 +1,3 @@ +pragma solidity v1.2.3; +// ---- +// ParserError 1684: (0-23): Found version pragma, but failed to parse it. Please ensure there is a trailing semicolon. diff --git a/test/libsolidity/syntaxTests/pragma/broken_version_7.sol b/test/libsolidity/syntaxTests/pragma/broken_version_7.sol new file mode 100644 index 000000000..b4b6fea7a --- /dev/null +++ b/test/libsolidity/syntaxTests/pragma/broken_version_7.sol @@ -0,0 +1,3 @@ +pragma solidity >0.5.0<; +// ---- +// ParserError 1684: (0-24): Found version pragma, but failed to parse it. Please ensure there is a trailing semicolon. diff --git a/test/libsolidity/syntaxTests/pragma/version_range.sol b/test/libsolidity/syntaxTests/pragma/version_range.sol new file mode 100644 index 000000000..4d6cdf6b9 --- /dev/null +++ b/test/libsolidity/syntaxTests/pragma/version_range.sol @@ -0,0 +1,2 @@ +pragma solidity >=0.4.0 <0.9.0; +// ----