Skip to content

Commit 205c8d5

Browse files
fixup! tests
1 parent 51648f0 commit 205c8d5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+445
-29
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--ast-compact-json --pretty-json --json-indent 4 --allow-paths .
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// SPDX-License-Identifier: GPL-3.0
2+
pragma solidity >=0.0;
3+
4+
contract C layout at 1234 + 4567 {}
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
JSON AST (compact format):
2+
3+
4+
======= ast_compact_json_storage_layout_specifier/input.sol =======
5+
{
6+
"absolutePath": "ast_compact_json_storage_layout_specifier/input.sol",
7+
"exportedSymbols": {
8+
"C": [
9+
6
10+
]
11+
},
12+
"id": 7,
13+
"license": "GPL-3.0",
14+
"nodeType": "SourceUnit",
15+
"nodes": [
16+
{
17+
"id": 1,
18+
"literals": [
19+
"solidity",
20+
">=",
21+
"0.0"
22+
],
23+
"nodeType": "PragmaDirective",
24+
"src": "36:22:0"
25+
},
26+
{
27+
"abstract": false,
28+
"baseContracts": [],
29+
"canonicalName": "C",
30+
"contractDependencies": [],
31+
"contractKind": "contract",
32+
"fullyImplemented": true,
33+
"id": 6,
34+
"linearizedBaseContracts": [
35+
6
36+
],
37+
"name": "C",
38+
"nameLocation": "69:1:0",
39+
"nodeType": "ContractDefinition",
40+
"nodes": [],
41+
"scope": 7,
42+
"src": "60:35:0",
43+
"storageLayout": {
44+
"baseSlotExpression": {
45+
"commonType": {
46+
"typeIdentifier": "t_rational_5801_by_1",
47+
"typeString": "int_const 5801"
48+
},
49+
"id": 4,
50+
"isConstant": false,
51+
"isLValue": false,
52+
"isPure": true,
53+
"lValueRequested": false,
54+
"leftExpression": {
55+
"hexValue": "31323334",
56+
"id": 2,
57+
"isConstant": false,
58+
"isLValue": false,
59+
"isPure": true,
60+
"kind": "number",
61+
"lValueRequested": false,
62+
"nodeType": "Literal",
63+
"src": "81:4:0",
64+
"typeDescriptions": {
65+
"typeIdentifier": "t_rational_1234_by_1",
66+
"typeString": "int_const 1234"
67+
},
68+
"value": "1234"
69+
},
70+
"nodeType": "BinaryOperation",
71+
"operator": "+",
72+
"rightExpression": {
73+
"hexValue": "34353637",
74+
"id": 3,
75+
"isConstant": false,
76+
"isLValue": false,
77+
"isPure": true,
78+
"kind": "number",
79+
"lValueRequested": false,
80+
"nodeType": "Literal",
81+
"src": "88:4:0",
82+
"typeDescriptions": {
83+
"typeIdentifier": "t_rational_4567_by_1",
84+
"typeString": "int_const 4567"
85+
},
86+
"value": "4567"
87+
},
88+
"src": "81:11:0",
89+
"typeDescriptions": {
90+
"typeIdentifier": "t_rational_5801_by_1",
91+
"typeString": "int_const 5801"
92+
}
93+
},
94+
"id": 5,
95+
"nodeType": "StorageLayoutSpecifier",
96+
"src": "71:21:0"
97+
},
98+
"usedErrors": [],
99+
"usedEvents": []
100+
}
101+
],
102+
"src": "36:60:0"
103+
}

test/cmdlineTests/inheritance_repeated_definition_error/in.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ contract A {
66
contract B {
77
}
88

9-
contract C is A is B {
9+
contract C is A, B is B {
1010
}

test/cmdlineTests/inheritance_repeated_definition_error/input.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
},
66
"settings": {
77
"outputSelection": {
8-
"fileA": { "*": ["*"], "": [ "*" ] }
8+
"*": {"*": ["*"], "": ["*"]}
99
}
1010
}
1111
}

test/cmdlineTests/inheritance_repeated_definition_error/output.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,32 @@
33
{
44
"component": "general",
55
"errorCode": "6668",
6-
"formattedMessage": "ParserError: Base contracts were already defined previously.
7-
--> fileA:9:17:
6+
"formattedMessage": "ParserError: More than one inheritance list.
7+
--> fileA:9:20:
88
|
9-
9 | contract C is A is B {
10-
| ^^
11-
Note: First inheritance definition is here
9+
9 | contract C is A, B is B {
10+
| ^^
11+
Note: Previous list:
1212
--> fileA:9:15:
1313
|
14-
9 | contract C is A is B {
14+
9 | contract C is A, B is B {
1515
| ^
1616

1717
",
18-
"message": "Base contracts were already defined previously.",
18+
"message": "More than one inheritance list.",
1919
"secondarySourceLocations": [
2020
{
2121
"end": 105,
2222
"file": "fileA",
23-
"message": "First inheritance definition is here",
23+
"message": "Previous list:",
2424
"start": 104
2525
}
2626
],
2727
"severity": "error",
2828
"sourceLocation": {
29-
"end": 108,
29+
"end": 111,
3030
"file": "fileA",
31-
"start": 106
31+
"start": 109
3232
},
3333
"type": "ParserError"
3434
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--import-ast -
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Error: Failed to import AST: Expected field "baseSlotExpression" is missing.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{
2+
"language": "SolidityAST",
3+
"sources": {
4+
"A": {
5+
"AST": {
6+
"absolutePath": "A",
7+
"exportedSymbols": {
8+
"C": [
9+
4
10+
]
11+
},
12+
"id": 5,
13+
"license": "GPL-3.0",
14+
"nodeType": "SourceUnit",
15+
"nodes": [
16+
{
17+
"id": 1,
18+
"literals": [
19+
"solidity",
20+
">=",
21+
"0.0"
22+
],
23+
"nodeType": "PragmaDirective",
24+
"src": "36:22:0"
25+
},
26+
{
27+
"abstract": false,
28+
"baseContracts": [],
29+
"canonicalName": "C",
30+
"contractDependencies": [],
31+
"contractKind": "contract",
32+
"fullyImplemented": true,
33+
"id": 4,
34+
"linearizedBaseContracts": [
35+
4
36+
],
37+
"name": "C",
38+
"nameLocation": "69:1:0",
39+
"nodeType": "ContractDefinition",
40+
"nodes": [],
41+
"scope": 5,
42+
"src": "60:28:0",
43+
"storageLayout": {
44+
"id": 3,
45+
"nodeType": "StorageLayoutSpecifier",
46+
"src": "71:16:0"
47+
},
48+
"usedErrors": [],
49+
"usedEvents": []
50+
}
51+
],
52+
"src": "36:53:0"
53+
},
54+
"id": 0
55+
}
56+
},
57+
"settings": {
58+
"outputSelection": {
59+
"*": { "*": [] }
60+
}
61+
}
62+
}

0 commit comments

Comments
 (0)