diff --git a/tests/functional/codegen/features/test_assignment.py b/tests/functional/codegen/features/test_assignment.py index eaafb527c1..6a2ddfba9c 100644 --- a/tests/functional/codegen/features/test_assignment.py +++ b/tests/functional/codegen/features/test_assignment.py @@ -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): @@ -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", [