Skip to content

Commit

Permalink
🧪 Add state var to test number of contract decls
Browse files Browse the repository at this point in the history
  • Loading branch information
ChmielewskiKamil committed Dec 17, 2024
1 parent 2226ca2 commit 7c6c887
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions parser/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,13 @@ func Test_ParseContractDeclaration(t *testing.T) {
src := `
contract MyContract is BaseContract {
uint256 public myVar;
function myFunction() public view returns (uint256) {
uint256 balance;
return myVar;
}
function test() public {}
}
`

Expand Down Expand Up @@ -224,8 +228,8 @@ func Test_ParseContractDeclaration(t *testing.T) {
t.Fatalf("Expected ContractBody, got nil")
}

if len(body.Declarations) != 2 {
t.Fatalf("Expected 2 declarations in the contract body, got %d", len(body.Declarations))
if len(body.Declarations) != 3 {
t.Fatalf("Expected 3 declarations in the contract body, got %d", len(body.Declarations))
}

// Verify state variable
Expand Down

0 comments on commit 7c6c887

Please sign in to comment.