mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #11295 from ethereum/semver-parser
Properly reject misformatted version pragmas
This commit is contained in:
commit
5b3169b5dc
@ -171,6 +171,8 @@ BOOST_AUTO_TEST_CASE(negative_range)
|
||||
{
|
||||
// Negative range tests
|
||||
vector<pair<string, string>> 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"},
|
||||
|
3
test/libsolidity/syntaxTests/pragma/broken_version_6.sol
Normal file
3
test/libsolidity/syntaxTests/pragma/broken_version_6.sol
Normal file
@ -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.
|
3
test/libsolidity/syntaxTests/pragma/broken_version_7.sol
Normal file
3
test/libsolidity/syntaxTests/pragma/broken_version_7.sol
Normal file
@ -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.
|
2
test/libsolidity/syntaxTests/pragma/version_range.sol
Normal file
2
test/libsolidity/syntaxTests/pragma/version_range.sol
Normal file
@ -0,0 +1,2 @@
|
||||
pragma solidity >=0.4.0 <0.9.0;
|
||||
// ----
|
Loading…
Reference in New Issue
Block a user