Add global string print test.

This commit is contained in:
Jacques Wagener 2019-03-08 01:50:02 +02:00
parent 0de46e8ded
commit a9a9fd7d0b
No known key found for this signature in database
GPG Key ID: C294D1025DA0E923
1 changed files with 22 additions and 0 deletions

View File

@ -39,3 +39,25 @@ def test():
c.functions.test().transact({"gas": 22000}) c.functions.test().transact({"gas": 22000})
assert get_last_out(stdout) == '-123' 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!"