Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
matheusaaguiar committed Dec 3, 2024
1 parent 6e9257f commit 2579486
Show file tree
Hide file tree
Showing 14 changed files with 53 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
contract C at layout 0x1234ABC { }
// ----
// ParserError 2314: (11-13): Expected '{' but got identifier
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
contract at layout at 0x1234ABC { }
// ----
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
contract layout layout at 0x1234ABC { }
// ----
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
contract C layout at 0x1234 {
uint layout;
function at() public pure { }
}
// ----
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
contract C layout at 0x1234 is A, B layout at 0xABC { }
// ----
// ParserError 8714: (36-42): Storage base location was already defined previously.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
contract C layout layout at 0x1234ABC { }
// ----
// ParserError 1994: (18-24): Expected 'at' but got identifier
// ParserError 2314: (28-37): Expected '{' but got 'Number'
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
contract C layout at 0xffff * (0x123 + 0xABC) { }
// ----
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
uint constant X = 42;
contract C layout at 0xffff * (50 - X) { }
// ----
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
function erc7201(bytes memory id) pure returns (uint256) {
return uint256(
keccak256(bytes.concat(bytes32(uint256(keccak256(id)) - 1))) &
~bytes32(uint256(0xff))
);
}
contract C layout at erc7201("C") { }
// ----
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
contract C layout at { }
// ----
// ParserError 6933: (21-22): Expected primary expression.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
contract C layout { }
// ----
// ParserError 1994: (18-19): Expected 'at' but got '{'
// ParserError 6933: (20-21): Expected primary expression.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
contract A { }
contract B { }
contract C is A, B layout at 0x1234 { }
contract D layout at 0xABCD is A, B { }
// ----
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
contract A layout at 0x1234 {}
contract B layout at 1024 {}
contract C layout at "C" {}
// ----
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
contract A {}
contract B {}
contract C is A is B{ }
// ----
// ParserError 6668: (44-46): Base contracts were already defined previously.

0 comments on commit 2579486

Please sign in to comment.