Update tests.

This commit is contained in:
Alexander Arlt
2019-11-01 14:54:47 -05:00
parent 793b906e05
commit cd3ad73b5a
109 changed files with 349 additions and 213 deletions
@@ -1,3 +0,0 @@
abstract abstract contract A { constructor() public {} }
// ----
// ParserError: (9-17): Contract expected.
@@ -0,0 +1,7 @@
interface A {
function utterance() external returns (bytes32);
}
contract B is A {
}
// ----
// TypeError: (69-88): Contract "B" should be marked as abstract.
@@ -1,3 +1,3 @@
abstract interface A { }
// ----
// ParserError: (0-8): Only contracts can be abstract.
// TypeError: (0-24): Only contracts can be abstract.
@@ -1,3 +1,3 @@
abstract library A { }
// ----
// ParserError: (0-8): Only contracts can be abstract.
// TypeError: (0-22): Only contracts can be abstract.
@@ -12,4 +12,4 @@ contract Parent {
contract Child is Parent {
}
// ----
// TypeError: (146-155): Trying to create an instance of an abstract contract.
// TypeError: (146-155): Cannot instantiate an abstract contract.
@@ -2,3 +2,5 @@ contract C {
function f() internal returns(uint[] storage);
function g() internal returns(uint[] storage s);
}
// ----
// TypeError: (0-118): Contract "C" should be marked as abstract.
@@ -2,3 +2,4 @@ contract test {
function f(bytes calldata) external;
}
// ----
// TypeError: (0-58): Contract "test" should be marked as abstract.
@@ -2,3 +2,4 @@ contract test {
function f(bytes memory) internal;
}
// ----
// TypeError: (0-56): Contract "test" should be marked as abstract.
@@ -2,3 +2,4 @@ contract test {
function f(bytes storage) internal;
}
// ----
// TypeError: (0-57): Contract "test" should be marked as abstract.
@@ -2,3 +2,4 @@ contract test {
function f(bytes memory) public;
}
// ----
// TypeError: (0-54): Contract "test" should be marked as abstract.
@@ -7,3 +7,4 @@ contract T {
}
// ----
// DeclarationError: (81-105): Identifier already declared.
// TypeError: (0-58): Contract "X" should be marked as abstract.
@@ -5,3 +5,5 @@ contract Y is X {
contract T {
constructor() public { new Y(); }
}
// ----
// TypeError: (0-57): Contract "X" should be marked as abstract.
@@ -7,3 +7,4 @@ contract T {
}
// ----
// DeclarationError: (79-103): Identifier already declared.
// TypeError: (0-56): Contract "X" should be marked as abstract.
@@ -9,3 +9,5 @@ contract X is A {
function test2() internal override(A) returns (uint256);
}
// ----
// TypeError: (0-126): Contract "A" should be marked as abstract.
// TypeError: (127-288): Contract "X" should be marked as abstract.
@@ -11,4 +11,7 @@ contract X is A, B {
function test() internal override returns (uint256);
}
// ----
// TypeError: (0-79): Contract "A" should be marked as abstract.
// TypeError: (80-183): Contract "B" should be marked as abstract.
// TypeError: (184-290): Derived contract must override function "foo". Function with the same name and parameter types defined in two or more base classes.
// TypeError: (184-290): Contract "X" should be marked as abstract.
@@ -18,3 +18,8 @@ contract X is D {
function foo() internal override returns (uint256);
}
// ----
// TypeError: (0-58): Contract "A" should be marked as abstract.
// TypeError: (60-132): Contract "B" should be marked as abstract.
// TypeError: (134-206): Contract "C" should be marked as abstract.
// TypeError: (208-280): Contract "D" should be marked as abstract.
// TypeError: (282-354): Contract "X" should be marked as abstract.
@@ -19,3 +19,8 @@ contract X is A, B, C, D {
function foo() internal override(A, B, C, D) returns (uint256);
}
// ----
// TypeError: (0-132): Contract "A" should be marked as abstract.
// TypeError: (133-236): Contract "B" should be marked as abstract.
// TypeError: (237-295): Contract "C" should be marked as abstract.
// TypeError: (296-354): Contract "D" should be marked as abstract.
// TypeError: (355-532): Contract "X" should be marked as abstract.
@@ -13,3 +13,7 @@ contract D is A, B, C {
function foo() internal override(A, B) returns (uint256);
}
// ----
// TypeError: (0-132): Contract "A" should be marked as abstract.
// TypeError: (133-191): Contract "B" should be marked as abstract.
// TypeError: (193-212): Contract "C" should be marked as abstract.
// TypeError: (213-297): Contract "D" should be marked as abstract.
@@ -20,7 +20,12 @@ contract X is A, B, C, D {
function foo() internal override(A, C, B, B, B, D ,D) returns (uint256);
}
// ----
// TypeError: (0-132): Contract "A" should be marked as abstract.
// TypeError: (133-236): Contract "B" should be marked as abstract.
// TypeError: (237-295): Contract "C" should be marked as abstract.
// TypeError: (296-399): Contract "D" should be marked as abstract.
// TypeError: (498-499): Duplicate contract "D" found in override list of "test".
// TypeError: (563-564): Duplicate contract "B" found in override list of "foo".
// TypeError: (560-561): Duplicate contract "B" found in override list of "foo".
// TypeError: (566-567): Duplicate contract "B" found in override list of "foo".
// TypeError: (572-573): Duplicate contract "D" found in override list of "foo".
// TypeError: (400-595): Contract "X" should be marked as abstract.
@@ -20,5 +20,10 @@ contract X is A, B, C, D {
function foo() internal override(A, C) returns (uint256);
}
// ----
// TypeError: (0-132): Contract "A" should be marked as abstract.
// TypeError: (133-236): Contract "B" should be marked as abstract.
// TypeError: (237-295): Contract "C" should be marked as abstract.
// TypeError: (296-399): Contract "D" should be marked as abstract.
// TypeError: (483-500): Invalid contract specified in override list: C.
// TypeError: (545-559): Function needs to specify overridden contracts B and D.
// TypeError: (400-580): Contract "X" should be marked as abstract.
@@ -11,4 +11,7 @@ contract X is A, B {
function test() internal override returns (uint256);
}
// ----
// TypeError: (0-79): Contract "A" should be marked as abstract.
// TypeError: (80-181): Contract "B" should be marked as abstract.
// TypeError: (182-288): Derived contract must override function "foo". Function with the same name and parameter types defined in two or more base classes.
// TypeError: (182-288): Contract "X" should be marked as abstract.
@@ -22,5 +22,8 @@ contract X is A, B, C, D {
function foo() internal override(MyStruct, ENUM, A, B, C, D) returns (uint256);
}
// ----
// TypeError: (552-560): Expected contract but got struct X.MyStruct.
// TypeError: (562-566): Expected contract but got enum X.ENUM.
// TypeError: (0-132): Contract "A" should be marked as abstract.
// TypeError: (133-236): Contract "B" should be marked as abstract.
// TypeError: (237-295): Contract "C" should be marked as abstract.
// TypeError: (296-354): Contract "D" should be marked as abstract.
// TypeError: (355-600): Contract "X" should be marked as abstract.
@@ -7,4 +7,5 @@ contract Other {
function f(uint) public returns (uint);
}
// ----
// TypeError: (131-193): Contract "Other" should be marked as abstract.
// TypeError: (97-121): Member "creationCode" not found or not visible after argument-dependent lookup in type(contract Other).
@@ -7,4 +7,5 @@ contract Other {
function f(uint) public returns (uint);
}
// ----
// TypeError: (124-186): Contract "Other" should be marked as abstract.
// TypeError: (91-114): Member "runtimeCode" not found or not visible after argument-dependent lookup in type(contract Other).
@@ -11,3 +11,4 @@ contract C
// ----
// SyntaxError: (203-236): Functions without implementation cannot have modifiers.
// SyntaxError: (241-274): Functions without implementation cannot have modifiers.
// TypeError: (153-276): Contract "C" should be marked as abstract.
@@ -19,6 +19,7 @@ contract C {
function four() public pure returns (uint, uint, uint, uint);
}
// ----
// TypeError: (0-649): Contract "C" should be marked as abstract.
// TypeError: (47-61): Different number of components on the left hand side (1) than on the right hand side (2).
// TypeError: (71-87): Different number of components on the left hand side (1) than on the right hand side (3).
// TypeError: (97-112): Different number of components on the left hand side (1) than on the right hand side (4).
@@ -19,6 +19,7 @@ contract C {
function five() public pure returns (uint, uint, uint, uint, uint);
}
// ----
// TypeError: (0-704): Contract "C" should be marked as abstract.
// TypeError: (53-72): Different number of components on the left hand side (2) than on the right hand side (3).
// TypeError: (82-101): Different number of components on the left hand side (2) than on the right hand side (3).
// TypeError: (111-130): Different number of components on the left hand side (3) than on the right hand side (5).
@@ -4,4 +4,5 @@ contract derived {
function foo() public { b = new base(); }
}
// ----
// TypeError: (104-112): Trying to create an instance of an abstract contract.
// TypeError: (0-40): Contract "base" should be marked as abstract.
// TypeError: (104-112): Cannot instantiate an abstract contract.
@@ -2,5 +2,6 @@ contract base { function foo() public; }
contract derived is base { function foo() public override {} }
contract wrong is derived { function foo() public; }
// ----
// TypeError: (0-40): Contract "base" should be marked as abstract.
// TypeError: (132-154): Overriding function is missing 'override' specifier.
// TypeError: (132-154): Redeclaring an already implemented function as abstract
@@ -2,3 +2,5 @@ contract M {
function f(uint[] memory) public;
function f(int[] memory) public;
}
// ----
// TypeError: (0-89): Contract "M" should be marked as abstract.
@@ -9,3 +9,4 @@ contract C is I {
}
}
// ----
// TypeError: (110-170): Contract "C" should be marked as abstract.
@@ -1,3 +1,5 @@
contract C {
function f(uint a) pure public returns (uint b);
}
// ----
// TypeError: (0-67): Contract "C" should be marked as abstract.
@@ -4,3 +4,5 @@ contract C {
this.transfer(10);
}
}
// ----
// TypeError: (0-109): Contract "C" should be marked as abstract.
@@ -4,3 +4,4 @@ contract C {
}
// ----
// DocstringParsingError: No description given for param id
// TypeError: (0-67): Contract "C" should be marked as abstract.
@@ -4,3 +4,4 @@ contract C {
}
// ----
// DocstringParsingError: End of tag @param not found
// TypeError: (0-64): Contract "C" should be marked as abstract.
@@ -1,3 +1,5 @@
contract test {
function functionName(bytes32 input) public returns (bytes32 out);
}
// ----
// TypeError: (0-85): Contract "test" should be marked as abstract.
@@ -33,6 +33,7 @@ contract Test
}
}
// ----
// TypeError: (0-2300): Contract "Test" should be marked as abstract.
// TypeError: (1218-1311): Type function (uint256) pure returns (string memory) is not implicitly convertible to expected type function (uint256) pure returns (uint256).
// TypeError: (1319-1425): Type function (uint256) pure returns (string storage pointer) is not implicitly convertible to expected type function (uint256) pure returns (string memory).
// TypeError: (1433-1531): Type function (uint256) pure returns (string memory) is not implicitly convertible to expected type function (string memory) pure returns (uint256).
@@ -5,4 +5,5 @@ contract b is a {
function f() public override { super.f(); }
}
// ----
// TypeError: (0-39): Contract "a" should be marked as abstract.
// TypeError: (93-100): Member "f" not found or not visible after argument-dependent lookup in contract super b.
@@ -9,4 +9,5 @@ contract c is a,b {
function f() public override(a, b) { super.f(); }
}
// ----
// TypeError: (0-39): Contract "a" should be marked as abstract.
// TypeError: (93-100): Member "f" not found or not visible after argument-dependent lookup in contract super b.
@@ -9,4 +9,5 @@ contract C {
// ----
// SyntaxError: (158-171): No visibility specified. Did you intend to add "external"?
// SyntaxError: (191-204): No visibility specified. Did you intend to add "public"?
// TypeError: (174-206): Contract "C" should be marked as abstract.
// TypeError: (158-171): Functions in interfaces must be declared external.