From b2f1d558da69dd41d83fd437928f8f3a39c4befd Mon Sep 17 00:00:00 2001 From: chriseth Date: Tue, 29 Sep 2020 16:43:04 +0200 Subject: [PATCH] Update existing tests. --- test/cmdlineTests/recovery_ast_empty_contract/err | 2 +- .../errorRecoveryTests/wrong_compiler_recovers_2.sol | 4 +++- .../array_length_cannot_be_constant_function_parameter.sol | 2 +- .../syntaxTests/freeFunctions/free_constructor.sol | 2 +- test/libsolidity/syntaxTests/freeFunctions/free_fallback.sol | 2 +- test/libsolidity/syntaxTests/freeFunctions/free_receive.sol | 2 +- .../nameAndTypeResolution/105_constant_input_parameter.sol | 2 +- test/libsolidity/syntaxTests/natspec/docstring_variable.sol | 2 +- .../syntaxTests/parsing/location_specifiers_for_params.sol | 2 +- test/libsolidity/syntaxTests/unexpected.sol | 2 +- 10 files changed, 12 insertions(+), 10 deletions(-) diff --git a/test/cmdlineTests/recovery_ast_empty_contract/err b/test/cmdlineTests/recovery_ast_empty_contract/err index ab976c155..f7324da63 100644 --- a/test/cmdlineTests/recovery_ast_empty_contract/err +++ b/test/cmdlineTests/recovery_ast_empty_contract/err @@ -1,4 +1,4 @@ -Error: Expected pragma, import directive or contract/interface/library/struct/enum/function definition. +Error: Expected pragma, import directive or contract/interface/library/struct/enum/constant/function definition. --> recovery_ast_empty_contract/input.sol:3:1: | 3 | c diff --git a/test/libsolidity/errorRecoveryTests/wrong_compiler_recovers_2.sol b/test/libsolidity/errorRecoveryTests/wrong_compiler_recovers_2.sol index 82f782f7e..1dcc4bc79 100644 --- a/test/libsolidity/errorRecoveryTests/wrong_compiler_recovers_2.sol +++ b/test/libsolidity/errorRecoveryTests/wrong_compiler_recovers_2.sol @@ -1,4 +1,6 @@ pragma solidity ^99.99.0; this is surely invalid // ---- -// ParserError 7858: (26-30): Expected pragma, import directive or contract/interface/library/struct/enum/function definition. +// ParserError 6635: (31-33): Expected identifier but got 'is' +// ParserError 6635: (34-40): Expected ';' but got identifier +// ParserError 6635: (49-49): Expected ';' but got end of source diff --git a/test/libsolidity/syntaxTests/array/length/array_length_cannot_be_constant_function_parameter.sol b/test/libsolidity/syntaxTests/array/length/array_length_cannot_be_constant_function_parameter.sol index c63967c38..cc979668c 100644 --- a/test/libsolidity/syntaxTests/array/length/array_length_cannot_be_constant_function_parameter.sol +++ b/test/libsolidity/syntaxTests/array/length/array_length_cannot_be_constant_function_parameter.sol @@ -4,6 +4,6 @@ contract C { } } // ---- -// DeclarationError 1788: (28-45): The "constant" keyword can only be used for state variables. +// DeclarationError 1788: (28-45): The "constant" keyword can only be used for state variables or variables at file level. // TypeError 5462: (69-72): Invalid array length, expected integer literal or constant expression. // TypeError 6651: (64-75): Data location must be "storage", "memory" or "calldata" for variable, but none was given. diff --git a/test/libsolidity/syntaxTests/freeFunctions/free_constructor.sol b/test/libsolidity/syntaxTests/freeFunctions/free_constructor.sol index afb375ca0..e44356dc3 100644 --- a/test/libsolidity/syntaxTests/freeFunctions/free_constructor.sol +++ b/test/libsolidity/syntaxTests/freeFunctions/free_constructor.sol @@ -1,3 +1,3 @@ constructor() {} // ---- -// ParserError 7858: (0-11): Expected pragma, import directive or contract/interface/library/struct/enum/function definition. +// ParserError 7858: (0-11): Expected pragma, import directive or contract/interface/library/struct/enum/constant/function definition. diff --git a/test/libsolidity/syntaxTests/freeFunctions/free_fallback.sol b/test/libsolidity/syntaxTests/freeFunctions/free_fallback.sol index 31b410211..e813e58ee 100644 --- a/test/libsolidity/syntaxTests/freeFunctions/free_fallback.sol +++ b/test/libsolidity/syntaxTests/freeFunctions/free_fallback.sol @@ -1,3 +1,3 @@ fallback(){} // ---- -// ParserError 7858: (0-8): Expected pragma, import directive or contract/interface/library/struct/enum/function definition. +// ParserError 7858: (0-8): Expected pragma, import directive or contract/interface/library/struct/enum/constant/function definition. diff --git a/test/libsolidity/syntaxTests/freeFunctions/free_receive.sol b/test/libsolidity/syntaxTests/freeFunctions/free_receive.sol index 5801b9e9e..d1e790d7c 100644 --- a/test/libsolidity/syntaxTests/freeFunctions/free_receive.sol +++ b/test/libsolidity/syntaxTests/freeFunctions/free_receive.sol @@ -1,3 +1,3 @@ receive() {} // ---- -// ParserError 7858: (0-7): Expected pragma, import directive or contract/interface/library/struct/enum/function definition. +// ParserError 7858: (0-7): Expected pragma, import directive or contract/interface/library/struct/enum/constant/function definition. diff --git a/test/libsolidity/syntaxTests/nameAndTypeResolution/105_constant_input_parameter.sol b/test/libsolidity/syntaxTests/nameAndTypeResolution/105_constant_input_parameter.sol index 154b68496..aaf6f620a 100644 --- a/test/libsolidity/syntaxTests/nameAndTypeResolution/105_constant_input_parameter.sol +++ b/test/libsolidity/syntaxTests/nameAndTypeResolution/105_constant_input_parameter.sol @@ -2,4 +2,4 @@ contract test { function f(uint[] memory constant a) public { } } // ---- -// DeclarationError 1788: (31-55): The "constant" keyword can only be used for state variables. +// DeclarationError 1788: (31-55): The "constant" keyword can only be used for state variables or variables at file level. diff --git a/test/libsolidity/syntaxTests/natspec/docstring_variable.sol b/test/libsolidity/syntaxTests/natspec/docstring_variable.sol index a126ca940..140ed468e 100644 --- a/test/libsolidity/syntaxTests/natspec/docstring_variable.sol +++ b/test/libsolidity/syntaxTests/natspec/docstring_variable.sol @@ -11,4 +11,4 @@ contract C { } } // ---- -// ParserError 2837: (290-295): Only state variables can have a docstring. +// ParserError 2837: (290-295): Only state variables or file-level variables can have a docstring. diff --git a/test/libsolidity/syntaxTests/parsing/location_specifiers_for_params.sol b/test/libsolidity/syntaxTests/parsing/location_specifiers_for_params.sol index a441c37b7..7d3dd5640 100644 --- a/test/libsolidity/syntaxTests/parsing/location_specifiers_for_params.sol +++ b/test/libsolidity/syntaxTests/parsing/location_specifiers_for_params.sol @@ -2,4 +2,4 @@ contract Foo { function f(uint[] storage constant x, uint[] memory y) internal { } } // ---- -// DeclarationError 1788: (30-55): The "constant" keyword can only be used for state variables. +// DeclarationError 1788: (30-55): The "constant" keyword can only be used for state variables or variables at file level. diff --git a/test/libsolidity/syntaxTests/unexpected.sol b/test/libsolidity/syntaxTests/unexpected.sol index 971c78000..1ffa40c21 100644 --- a/test/libsolidity/syntaxTests/unexpected.sol +++ b/test/libsolidity/syntaxTests/unexpected.sol @@ -1,3 +1,3 @@ unexpected // ---- -// ParserError 7858: (0-10): Expected pragma, import directive or contract/interface/library/struct/enum/function definition. +// ParserError 7858: (0-10): Expected pragma, import directive or contract/interface/library/struct/enum/constant/function definition.