diff --git a/tests/variables/test_print.py b/tests/variables/test_print.py index 88ff7e6..e76fed8 100644 --- a/tests/variables/test_print.py +++ b/tests/variables/test_print.py @@ -39,3 +39,25 @@ def test(): c.functions.test().transact({"gas": 22000}) assert get_last_out(stdout) == '-123' + + +def test_print_string_from_storage(get_contract, get_last_out): + code = """ +car: public(string[64]) + +@public +def getCar() -> string[64]: + self.car = "My little car!" + vdb + return self.car + """ + + stdin = io.StringIO( + "self.car\n" + ) + stdout = io.StringIO() + + c = get_contract(code, stdin=stdin, stdout=stdout) + c.functions.getCar().call({"gas": 92000}) + + assert get_last_out(stdout) == "My little car!"