From e63333b3e8c090b1be91021d5fb8a8661da8e7cb Mon Sep 17 00:00:00 2001 From: Harry Kalogirou Date: Wed, 12 Jun 2024 11:43:29 +0300 Subject: [PATCH] test the #4072 issue's case --- tests/functional/codegen/venom/test_double_eval.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 tests/functional/codegen/venom/test_double_eval.py diff --git a/tests/functional/codegen/venom/test_double_eval.py b/tests/functional/codegen/venom/test_double_eval.py new file mode 100644 index 0000000000..eadc768f9b --- /dev/null +++ b/tests/functional/codegen/venom/test_double_eval.py @@ -0,0 +1,14 @@ + +def test_double_eval_pop(get_contract): + code = f""" +m: HashMap[uint256, String[33]] + +@external +def foo() -> uint256: + x: DynArray[uint256, 32] = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1] + self.m[x.pop()] = "Hello world" + return len(x) +""" + + c = get_contract(code) + assert c.foo() == 31 \ No newline at end of file