Skip to content

Commit

Permalink
add test for pop
Browse files Browse the repository at this point in the history
  • Loading branch information
tserg committed Aug 5, 2023
1 parent eed6755 commit e28a9e9
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/parser/syntax/test_for_range.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,20 @@ def bar(x:address):
""",
ImmutableViolation,
),
# Cannot call `pop()` in for range because it modifies state
(
"""
arr: DynArray[uint256, 10]
@external
def test()-> (DynArray[uint256, 6], DynArray[uint256, 10]):
b: DynArray[uint256, 6] = []
self.arr = [1,0]
for i in range(self.arr.pop(), self.arr.pop() + 2):
b.append(i)
return b, self.arr
""",
ImmutableViolation,
)
]


Expand Down

0 comments on commit e28a9e9

Please sign in to comment.