Skip to content

Commit

Permalink
add a test
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-cooper committed Feb 21, 2025
1 parent 49434d5 commit 63f3648
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion tests/functional/codegen/features/test_assignment.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pytest

from vyper.exceptions import ImmutableViolation, InvalidType, TypeMismatch
from vyper.exceptions import CodegenPanic, ImmutableViolation, InvalidType, TypeMismatch


def test_augassign(get_contract):
Expand Down Expand Up @@ -39,6 +39,21 @@ def augmod(x: int128, y: int128) -> int128:
print("Passed aug-assignment test")


@pytest.mark.xfail(strict=True, raises=CodegenPanic)
def test_augassign_oob(get_contract, tx_failed):
code = """
def poc():
a: DynArray[uint256, 2] = [1, 2]
a[1] += a.pop()
"""
# xfail here (with panic):
c = get_contract(code)

# not reached until the panic is fixed
with tx_failed(c):
c.poc()


@pytest.mark.parametrize(
"typ,in_val,out_val",
[
Expand Down

0 comments on commit 63f3648

Please sign in to comment.